-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQBStats.R
More file actions
63 lines (57 loc) · 3.1 KB
/
Copy pathQBStats.R
File metadata and controls
63 lines (57 loc) · 3.1 KB
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
qbstats = read.csv(file = file.choose(), header = T,
sep = ",", stringsAsFactors = F)
qbstats[13188,]
xy1 = data.frame(matrix(NA, nrow = 13188, ncol = 2))
xy1[1] = qbstats[,2]
xy1[2] = qbstats[,3]
xy1
colMeans(xy1)
#Plot 1
pass_yards_per_game = data.frame(Year = 1996:2016,
PYPG = c(170.900161, 168.730169, 165.242991, 174.505393,
171.282813, 178.991817, 178.814529, 163.153846,
177.990741, 175.386185, 181.090935, 181.463224,
183.332268, 176.599001, 193.513600, 204.120521,
208.528146, 217.704584, 209.250000, 224.136824,
213.921311))
plot(pass_yards_per_game, type = "o", main = "Pass Yds/Gm 1996-2016",
col = "steelblue")
#Plot 2
yds_per_att = data.frame(Year = 1996:2016,
YPA = c(6.58921095, 6.740705128, 6.768535826, 6.553775039,
6.82065, 7.13207856, 6.621329212, 6.594419306,
6.776697531, 6.83155416, 6.714032258, 6.750234742,
7.032587859,6.793740686, 6.75904, 7.194136808,
7.14486755, 7.191680815, 7.308279221, 7.255912162,
7.086065574))
plot(yds_per_att, type = "o", main = "Yds/Attempt 1996-2016",
col = "steelblue")
#Plot 3
int_per_gm = data.frame(Year = 1996:2016,
INTs = c(0.866345, 0.767628, 0.792835, 0.865948, 0.823438,
0.888707, 0.809892, 0.799397, 0.808642, 0.794349,
0.838710, 0.829421, 0.742812, 0.798165, 0.817600,
0.824104, 0.774834, 0.847199, 0.730519, 0.736486,
0.67541))
plot(int_per_gm, type = "o", main = "Int/Gm 1996-2016",
col = "steelblue")
#Lying with Data Plot 1
cmp_per_game = data.frame(Year = 1996:2016,
CMP = c(14.72141707, 14.17307692, 13.65420561,
14.74114022, 14.75625, 15.57774141,
15.87326121, 14.4479638, 15.08024691,
15.3689168, 15.8, 16.17527387, 16.10383387,
15.90312966, 16.7856, 17.04234528, 17.9354046,
18.7147708, 18.18181818, 19.47128378,
18.83606557))
plot(cmp_per_game, type="o", main = "CMP/Gm 1996-2016", ylab = "CMP/Game",
xlab = "Year")
#Lying with Data Plot 2
att_per_game = data.frame(Year = 1996:2016,
ATT = c(25.559, 25.207, 24.126, 25.824, 25.366,
26.390, 26.617, 24.611, 25.238, 25.846,
26.434, 26.454, 26.399, 25.459, 27.630,
28.355, 29.450, 30.565, 29.024, 30.909,
29.895))
plot(att_per_game, type = "o", main = "Att/Gm 1996-2016", xlab = "Year",
ylab = "Att/Game", col = "steelblue")