-
Notifications
You must be signed in to change notification settings - Fork 2
/
.Rhistory
512 lines (512 loc) · 28.7 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
watson<-t(temp5)
colnames(watson)<- c("2013", "2012", "2011")
boxplot(watson)
summary(watson)
watsonTot <- apply(watson, 2,function(x) sum(x, na.rm=T))
watson13<- watson[,1]/watsonTot[1]
watson13<-watson13[order(watson13, decreasing = T)]
watson12<- watson[,2]/watsonTot[2]
watson12<-watson12[order(watson12, decreasing = T)]
watson11<-watson[,3]/watsonTot[3]
watson11<-watson11[order(watson11, decreasing = T)]
summaryStat[4,] <- c("watson", sum(watson13[1:3]), sum(watson13[1:6]), sum(watson12[1:3]), sum(watson12[1:6]), sum(watson11[1:3]), sum(watson11[1:6]))
####Kuchar####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 13]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 14]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 15]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
kuchar<-t(temp5)
colnames(kuchar)<- c("2013", "2012", "2011")
boxplot(kuchar)
summary(kuchar)
kucharTot <- apply(kuchar, 2,function(x) sum(x, na.rm=T))
kuchar13<- kuchar[,1]/kucharTot[1]
kuchar13<-kuchar13[order(kuchar13, decreasing = T)]
kuchar12<- kuchar[,2]/kucharTot[2]
kuchar12<-kuchar12[order(kuchar12, decreasing = T)]
kuchar11<-kuchar[,3]/kucharTot[3]
kuchar11<-kuchar11[order(kuchar11, decreasing = T)]
summaryStat[5,] <- c("kuchar", sum(kuchar13[1:3]), sum(kuchar13[1:6]), sum(kuchar12[1:3]), sum(kuchar12[1:6]), sum(kuchar11[1:3]), sum(kuchar11[1:6]))
####Bradely####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 16]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 17]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 18]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
brad<-t(temp5)
colnames(brad)<- c("2013", "2012", "2011")
boxplot(brad)
summary(brad)
bradTot <- apply(brad, 2,function(x) sum(x, na.rm=T))
brad13<- brad[,1]/bradTot[1]
brad13<-brad13[order(brad13, decreasing = T)]
brad12<- brad[,2]/bradTot[2]
brad12<-brad12[order(brad12, decreasing = T)]
brad11<-brad[,3]/bradTot[3]
brad11<-brad11[order(brad11, decreasing = T)]
summaryStat[6,] <- c("brad", sum(brad13[1:3]), sum(brad13[1:6]), sum(brad12[1:3]), sum(brad12[1:6]), sum(brad11[1:3]), sum(brad11[1:6]))
####Duval####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 19]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 20]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 21]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
duv<-t(temp5)
colnames(duv)<- c("2013", "2012", "2011")
boxplot(duv)
summary(duv)
duvTot <- apply(duv, 2,function(x) sum(x, na.rm=T))
duv13<- duv[,1]/duvTot[1]
duv13<-duv13[order(duv13, decreasing = T)]
duv12<- duv[,2]/duvTot[2]
duv12<-duv12[order(duv12, decreasing = T)]
duv11<-duv[,3]/duvTot[3]
duv11<-duv11[order(duv11, decreasing = T)]
summaryStat[7,] <- c("duv", sum(duv13[1:3]), sum(duv13[1:6]), sum(duv12[1:3]), sum(duv12[1:6]), sum(duv11[1:3]), sum(duv11[1:6]))
####Fowler####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 22]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 23]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 24]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
fowler<-t(temp5)
colnames(fowler)<- c("2013", "2012", "2011")
boxplot(fowler)
summary(fowler)
fowlerTot <- apply(fowler, 2,function(x) sum(x, na.rm=T))
fowler13<- fowler[,1]/fowlerTot[1]
fowler13<-fowler13[order(fowler13, decreasing = T)]
fowler12<- fowler[,2]/fowlerTot[2]
fowler12<-fowler12[order(fowler12, decreasing = T)]
fowler11<-fowler[,3]/fowlerTot[3]
fowler11<-fowler11[order(fowler11, decreasing = T)]
summaryStat[8,] <- c("fowler", sum(fowler13[1:3]), sum(fowler13[1:6]), sum(fowler12[1:3]), sum(fowler12[1:6]), sum(fowler11[1:3]), sum(fowler11[1:6]))
####Furyk####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 25]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 26]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 27]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
furyk<-t(temp5)
colnames(furyk)<- c("2013", "2012", "2011")
boxplot(furyk)
summary(furyk)
furykTot <- apply(furyk, 2,function(x) sum(x, na.rm=T))
furyk13<- furyk[,1]/furykTot[1]
furyk13<-furyk13[order(furyk13, decreasing = T)]
furyk12<- furyk[,2]/furykTot[2]
furyk12<-furyk12[order(furyk12, decreasing = T)]
furyk11<-furyk[,3]/furykTot[3]
furyk11<-furyk11[order(furyk11, decreasing = T)]
summaryStat[9,] <- c("furyk", sum(furyk13[1:3]), sum(furyk13[1:6]), sum(furyk12[1:3]), sum(furyk12[1:6]), sum(furyk11[1:3]), sum(furyk11[1:6]))
####Clark####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 28]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 29]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 30]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
clark<-t(temp5)
colnames(clark)<- c("2013", "2012", "2011")
boxplot(clark)
summary(clark)
clarkTot <- apply(clark, 2,function(x) sum(x, na.rm=T))
clark13<- clark[,1]/clarkTot[1]
clark13<-clark13[order(clark13, decreasing = T)]
clark12<- clark[,2]/clarkTot[2]
clark12<-clark12[order(clark12, decreasing = T)]
clark11<-clark[,3]/clarkTot[3]
clark11<-clark11[order(clark11, decreasing = T)]
summaryStat[10,] <- c("clark", sum(clark13[1:3]), sum(clark13[1:6]), sum(clark12[1:3]), sum(clark12[1:6]), sum(clark11[1:3]), sum(clark11[1:6]))
####Ohair####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 31]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 32]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 33]
temp4<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 34]
temp <- rbind(temp1, temp2, temp3, temp4)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
ohair<-t(temp5)
colnames(ohair)<- c("2013", "2012", "2011", "2010")
boxplot(ohair)
summary(ohair)
ohairTot <- apply(ohair, 2,function(x) sum(x, na.rm=T))
ohair13<- ohair[,1]/ohairTot[1]
ohair13<-ohair13[order(ohair13, decreasing = T)]
ohair12<- ohair[,2]/ohairTot[2]
ohair12<-ohair12[order(ohair12, decreasing = T)]
ohair11<-ohair[,3]/ohairTot[3]
ohair11<-ohair11[order(ohair11, decreasing = T)]
summaryStat[11,] <- c("ohair", sum(ohair13[1:3]), sum(ohair13[1:6]), sum(ohair12[1:3]), sum(ohair12[1:6]), sum(ohair11[1:3]), sum(ohair11[1:6]))
#Make numeric
summaryStat[,2] <- as.numeric(summaryStat[,2])
summaryStat[,3] <- as.numeric(summaryStat[,3])
summaryStat[,4] <- as.numeric(summaryStat[,4])
summaryStat[,5] <- as.numeric(summaryStat[,5])
summaryStat[,6] <- as.numeric(summaryStat[,6])
summaryStat[,7] <- as.numeric(summaryStat[,7])
lapply(summaryStat, class)
round(mean(mean(summaryStat[,c(2,4,6)], na.rm=T))*100, 1)
mean(summaryStat[,c(2,4,6)], na.rm=T)
lapply(ummaryStat[,c(2,4,6)], class)
lapply(summaryStat[,c(2,4,6)], class)
mean(summaryStat[,c(2,4,6)], na.rm=T)
mean(summaryStat[,c(2], na.rm=T)
mean(summaryStat[,c(2)], na.rm=T)
mean(summaryStat[,2], na.rm=T)
setwd('~/Golf Statistics')
all<-read.csv('./data/Winning Stats.csv', header=FALSE, stringsAsFactors=F)
summaryStat <- data.frame(Name=character(),
Three2013=as.numeric(character()), Six2013=as.numeric(character()),
Three2012=as.numeric(character()), Six2012=as.numeric(character()),
Three2011=as.numeric(character()), Six2011=as.numeric(character()),
stringsAsFactors=FALSE)
####Tiger####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 1]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 2]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 3]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
tiger<-t(temp5)
colnames(tiger)<- c("2013", "2012", "2011")
boxplot(tiger)
summary(tiger)
tigerTot <- apply(tiger, 2,function(x) sum(x, na.rm=T))
tiger13<- tiger[,1]/tigerTot[1]
tiger13<-tiger13[order(tiger13, decreasing = T)]
tiger12<- tiger[,2]/tigerTot[2]
tiger12<-tiger12[order(tiger12, decreasing = T)]
tiger11<-tiger[,3]/tigerTot[3]
tiger11<-tiger11[order(tiger11, decreasing = T)]
summaryStat[1,] <- c("Tiger", sum(tiger13[1:3]), sum(tiger13[1:6]), sum(tiger12[1:3]), sum(tiger12[1:6]), sum(tiger11[1:3]), sum(tiger11[1:6]))
####Crane####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 4]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 5]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 6]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
crane<-t(temp5)
colnames(crane)<- c("2013", "2012", "2011")
boxplot(crane)
summary(crane)
craneTot <- apply(crane, 2,function(x) sum(x, na.rm=T))
crane13<- crane[,1]/craneTot[1]
crane13<-crane13[order(crane13, decreasing = T)]
crane12<- crane[,2]/craneTot[2]
crane12<-crane12[order(crane12, decreasing = T)]
crane11<-crane[,3]/craneTot[3]
crane11<-crane11[order(crane11, decreasing = T)]
summaryStat[2,] <- c("crane", sum(crane13[1:3]), sum(crane13[1:6]), sum(crane12[1:3]), sum(crane12[1:6]), sum(crane11[1:3]), sum(crane11[1:6]))
####Baddeley####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 7]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 8]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 9]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
bad<-t(temp5)
colnames(bad)<- c("2013", "2012", "2011")
boxplot(bad)
summary(bad)
badTot <- apply(bad, 2,function(x) sum(x, na.rm=T))
bad13<- bad[,1]/badTot[1]
bad13<-bad13[order(bad13, decreasing = T)]
bad12<- bad[,2]/badTot[2]
bad12<-bad12[order(bad12, decreasing = T)]
bad11<-bad[,3]/badTot[3]
bad11<-bad11[order(bad11, decreasing = T)]
summaryStat[3,] <- c("bad", sum(bad13[1:3]), sum(bad13[1:6]), sum(bad12[1:3]), sum(bad12[1:6]), sum(bad11[1:3]), sum(bad11[1:6]))
####Watson####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 10]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 11]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 12]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
watson<-t(temp5)
colnames(watson)<- c("2013", "2012", "2011")
boxplot(watson)
summary(watson)
watsonTot <- apply(watson, 2,function(x) sum(x, na.rm=T))
watson13<- watson[,1]/watsonTot[1]
watson13<-watson13[order(watson13, decreasing = T)]
watson12<- watson[,2]/watsonTot[2]
watson12<-watson12[order(watson12, decreasing = T)]
watson11<-watson[,3]/watsonTot[3]
watson11<-watson11[order(watson11, decreasing = T)]
summaryStat[4,] <- c("watson", sum(watson13[1:3]), sum(watson13[1:6]), sum(watson12[1:3]), sum(watson12[1:6]), sum(watson11[1:3]), sum(watson11[1:6]))
####Kuchar####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 13]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 14]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 15]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
kuchar<-t(temp5)
colnames(kuchar)<- c("2013", "2012", "2011")
boxplot(kuchar)
summary(kuchar)
kucharTot <- apply(kuchar, 2,function(x) sum(x, na.rm=T))
kuchar13<- kuchar[,1]/kucharTot[1]
kuchar13<-kuchar13[order(kuchar13, decreasing = T)]
kuchar12<- kuchar[,2]/kucharTot[2]
kuchar12<-kuchar12[order(kuchar12, decreasing = T)]
kuchar11<-kuchar[,3]/kucharTot[3]
kuchar11<-kuchar11[order(kuchar11, decreasing = T)]
summaryStat[5,] <- c("kuchar", sum(kuchar13[1:3]), sum(kuchar13[1:6]), sum(kuchar12[1:3]), sum(kuchar12[1:6]), sum(kuchar11[1:3]), sum(kuchar11[1:6]))
####Bradely####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 16]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 17]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 18]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
brad<-t(temp5)
colnames(brad)<- c("2013", "2012", "2011")
boxplot(brad)
summary(brad)
bradTot <- apply(brad, 2,function(x) sum(x, na.rm=T))
brad13<- brad[,1]/bradTot[1]
brad13<-brad13[order(brad13, decreasing = T)]
brad12<- brad[,2]/bradTot[2]
brad12<-brad12[order(brad12, decreasing = T)]
brad11<-brad[,3]/bradTot[3]
brad11<-brad11[order(brad11, decreasing = T)]
summaryStat[6,] <- c("brad", sum(brad13[1:3]), sum(brad13[1:6]), sum(brad12[1:3]), sum(brad12[1:6]), sum(brad11[1:3]), sum(brad11[1:6]))
####Duval####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 19]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 20]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 21]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
duv<-t(temp5)
colnames(duv)<- c("2013", "2012", "2011")
boxplot(duv)
summary(duv)
duvTot <- apply(duv, 2,function(x) sum(x, na.rm=T))
duv13<- duv[,1]/duvTot[1]
duv13<-duv13[order(duv13, decreasing = T)]
duv12<- duv[,2]/duvTot[2]
duv12<-duv12[order(duv12, decreasing = T)]
duv11<-duv[,3]/duvTot[3]
duv11<-duv11[order(duv11, decreasing = T)]
summaryStat[7,] <- c("duv", sum(duv13[1:3]), sum(duv13[1:6]), sum(duv12[1:3]), sum(duv12[1:6]), sum(duv11[1:3]), sum(duv11[1:6]))
####Fowler####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 22]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 23]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 24]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
fowler<-t(temp5)
colnames(fowler)<- c("2013", "2012", "2011")
boxplot(fowler)
summary(fowler)
fowlerTot <- apply(fowler, 2,function(x) sum(x, na.rm=T))
fowler13<- fowler[,1]/fowlerTot[1]
fowler13<-fowler13[order(fowler13, decreasing = T)]
fowler12<- fowler[,2]/fowlerTot[2]
fowler12<-fowler12[order(fowler12, decreasing = T)]
fowler11<-fowler[,3]/fowlerTot[3]
fowler11<-fowler11[order(fowler11, decreasing = T)]
summaryStat[8,] <- c("fowler", sum(fowler13[1:3]), sum(fowler13[1:6]), sum(fowler12[1:3]), sum(fowler12[1:6]), sum(fowler11[1:3]), sum(fowler11[1:6]))
####Furyk####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 25]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 26]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 27]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
furyk<-t(temp5)
colnames(furyk)<- c("2013", "2012", "2011")
boxplot(furyk)
summary(furyk)
furykTot <- apply(furyk, 2,function(x) sum(x, na.rm=T))
furyk13<- furyk[,1]/furykTot[1]
furyk13<-furyk13[order(furyk13, decreasing = T)]
furyk12<- furyk[,2]/furykTot[2]
furyk12<-furyk12[order(furyk12, decreasing = T)]
furyk11<-furyk[,3]/furykTot[3]
furyk11<-furyk11[order(furyk11, decreasing = T)]
summaryStat[9,] <- c("furyk", sum(furyk13[1:3]), sum(furyk13[1:6]), sum(furyk12[1:3]), sum(furyk12[1:6]), sum(furyk11[1:3]), sum(furyk11[1:6]))
####Clark####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 28]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 29]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 30]
temp <- rbind(temp1, temp2, temp3)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
clark<-t(temp5)
colnames(clark)<- c("2013", "2012", "2011")
boxplot(clark)
summary(clark)
clarkTot <- apply(clark, 2,function(x) sum(x, na.rm=T))
clark13<- clark[,1]/clarkTot[1]
clark13<-clark13[order(clark13, decreasing = T)]
clark12<- clark[,2]/clarkTot[2]
clark12<-clark12[order(clark12, decreasing = T)]
clark11<-clark[,3]/clarkTot[3]
clark11<-clark11[order(clark11, decreasing = T)]
summaryStat[10,] <- c("clark", sum(clark13[1:3]), sum(clark13[1:6]), sum(clark12[1:3]), sum(clark12[1:6]), sum(clark11[1:3]), sum(clark11[1:6]))
####Ohair####
temp1<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 31]
temp2<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 32]
temp3<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 33]
temp4<- all[c(27, 38, 49, 60, 71, 82, 93, 104, 115, 126, 137, 148, 159, 170, 181, 192, 203, 214, 225, 236, 247, 258, 269, 280, 291, 302, 313, 324), 34]
temp <- rbind(temp1, temp2, temp3, temp4)
temp5<-as.data.frame(temp, stringsAsFactors=F)
#remove $ , % from data
for (i in grep("--", temp5)) temp5[,i]<-gsub("--", "0", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in grep(",", temp5)) temp5[,i]<-gsub(",", "", temp5[,i])
for (i in grep("\\$", temp5)) temp5[,i]<-gsub("\\$", "", temp5[,i])
for (i in 1:ncol(temp5)) temp5[,i] <- as.numeric(temp5[,i])
ohair<-t(temp5)
colnames(ohair)<- c("2013", "2012", "2011", "2010")
boxplot(ohair)
summary(ohair)
ohairTot <- apply(ohair, 2,function(x) sum(x, na.rm=T))
ohair13<- ohair[,1]/ohairTot[1]
ohair13<-ohair13[order(ohair13, decreasing = T)]
ohair12<- ohair[,2]/ohairTot[2]
ohair12<-ohair12[order(ohair12, decreasing = T)]
ohair11<-ohair[,3]/ohairTot[3]
ohair11<-ohair11[order(ohair11, decreasing = T)]
summaryStat[11,] <- c("ohair", sum(ohair13[1:3]), sum(ohair13[1:6]), sum(ohair12[1:3]), sum(ohair12[1:6]), sum(ohair11[1:3]), sum(ohair11[1:6]))
#Make numeric
summaryStat[,2] <- as.numeric(summaryStat[,2])
summaryStat[,3] <- as.numeric(summaryStat[,3])
summaryStat[,4] <- as.numeric(summaryStat[,4])
summaryStat[,5] <- as.numeric(summaryStat[,5])
summaryStat[,6] <- as.numeric(summaryStat[,6])
summaryStat[,7] <- as.numeric(summaryStat[,7])
lapply(summaryStat, class)
mean(summaryStat[,2], na.rm=T)
mean(summaryStat[,4], na.rm=T)
mean(summaryStat[,6], na.rm=T)
round(mean(mean(summaryStat[,c(2,4,6)], na.rm=T))*100
,1)
mean(summaryStat[,c(2,4,6)], na.rm=T)
mean(summaryStat[,2], na.rm=T)
mean(summaryStat[,4], na.rm=T)
mean(summaryStat[,6], na.rm=T)
mean(summaryStat[,c(2,4,6)], na.rm=T)
summaryStat[,c(2,4,6)]
mean(summaryStat[,c(4,6)], na.rm=T)
lapply(summaryStat[,c(2,4,6)], class)
summaryThree <- summaryStat[,c(2,4,6)]
summaryThree
summaryThree <- rbind(summaryStat[,2], summaryStat[,4], summaryStat[,6])
summaryThree
summaryThree <- cbind(summaryStat[,2], summaryStat[,4], summaryStat[,6])
summaryThree
summaryThree <- c(summaryStat[,2], summaryStat[,4], summaryStat[,6])
summaryThree
mean(summaryThree)
mean(summaryThree, na.rm=T)
summaryThree <- c(summaryStat[,2], summaryStat[,4], summaryStat[,6])
summarySix <- c(summaryStat[,3], summaryStat[,5], summaryStat[,7])
round(mean(summaryThree, na.rm=T)*100,1)
round(mean(summarySix, na.rm=T)*100,1)