-
Notifications
You must be signed in to change notification settings - Fork 0
/
38-week_38.Rmd
218 lines (140 loc) · 5.8 KB
/
38-week_38.Rmd
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
# Week 38 {-}
Very little to play for - other than stacks of place money
Well at least we got a nine goal thriller. And Lamela scored twice, his first of the season!
***
<p class="factoid">Lucas Moura records the 50th 4-assist game in EPL history on the final day of the season, matching Spurs teammate Eriksen who did the same trick on the last day of 2016/17</p>
***
## Man City Records {-}
City set a plethora of records including for wins, points and goals in an EPL season. They were also only the second team (Man. Utd. 1999/00) to have six players reach the 20 Goals and Assists combined mark
They also very rarely trailed in games
```{r mins_behind_38}
data <- scoreLines %>%
left_join(teamGames) %>%
left_join(standings, by = c("MATCHID" = "MATCHID", "TEAMNAME" = "team")) %>%
select(
team = TEAMNAME,
season = season.x,
gameDate = gameDate.x,
mins,
diff,
tmYrGameOrder = tmYrGameOrder.x,
GF = GF.y,
GA = GA.y,
OppTeam,
final_Pos
)
test <- data %>%
rename(TEAMMATCHID = TEAMMATCHID.x) %>%
filter(season == "2017/18" & team == "Man. City") %>%
mutate(
up = if_else(diff > 0, 1, 0),
down = if_else(diff < 0, 1, 0),
even = if_else(diff == 0, 1, 0)
) %>%
group_by(TEAMMATCHID, tmYrGameOrder) %>%
summarize(up = sum(up),
down = sum(down),
even = sum(even)) %>%
gather(category, time, -c(tmYrGameOrder, TEAMMATCHID))
## team by game - but overall not by minute
test %>%
plot_ly(x = ~ tmYrGameOrder, y = ~ time) %>%
add_bars(color = ~ category) %>%
layout(
barmode = "stack",
yaxis = list(title = "Mins"),
xaxis = list(title = "")
)
```
and the total of 156 minutes total time in arrears is the lowest in Premier League history
---
Here is every team's record for time up/down/even over a full season
```{r up_down_38}
data %>%
ungroup() %>%
group_by(season, team) %>%
mutate(
up = if_else(diff > 0, 1, 0),
down = if_else(diff < 0, 1, 0),
even = if_else(diff == 0, 1, 0)
) %>%
summarize(up = sum(up),
even = sum(even),
down = sum(down)) %>%
arrange(down) %>%
DT::datatable(
class = 'compact stripe hover row-border order-column',
rownames = FALSE,
options = list(
paging = TRUE,
searching = TRUE,
info = FALSE
)
)
```
---
<p class="factoid">In spite of their dismal start, Palace scored at least two goals at home on eleven occasions, bettering teams like Spurs(9) and Chelsea(8)</p>
---
## Leaving with a Bang {-}
Well Swansea certainly didn't as they went from appearing safe - with a fall-back position of the final two home games against Southampton and Stoke - to the drop
On the other hand, Stoke and, to a greater extent, WBA at least made it interesting. Here are the number of losses relegated teams (since the 38 season began) have suffered in their final five games
```{r down_38}
relegated <- standings %>%
filter(season > "1994/95") %>%
select(season, team, final_Pos) %>%
unique() %>%
group_by(season) %>%
arrange(desc(final_Pos)) %>%
slice(1:3) %>%
select(season, team)
losses_last_games <- function(x, y) {
standings %>%
filter(team == x,
season == y,
between(tmYrGameOrder, 34, 38),
res == "Loss") %>%
tally()
}
losses <-
map2_df(relegated$team, relegated$season, losses_last_games)
df <- bind_cols(relegated, losses)
df %>%
arrange(n, desc(season)) %>%
rename(losses = n) %>%
DT::datatable(
class = 'compact stripe hover row-border order-column',
rownames = FALSE,
options = list(
paging = TRUE,
searching = TRUE,
info = FALSE
)
)
```
Swansea leave the division on the back of five consecutive defeats, a rarity even for the poorest sides
It is the only season in which two teams only lost once at the end. Both
Stoke and WBA suffered at the hands of Crustal Palace
***
## Tweet of the Week {-}
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/AFC?src=hash&ref_src=twsrc%5Etfw">#AFC</a> no away points after 7 <a href="https://twitter.com/hashtag/EPL?src=hash&ref_src=twsrc%5Etfw">#EPL</a> games in 2018<br>Previous years range from 6 -19 (2002)<a href="https://twitter.com/ArsenalFanTV?ref_src=twsrc%5Etfw">@ArsenalFanTV</a> <a href="https://t.co/Xa8VzG5N44">pic.twitter.com/Xa8VzG5N44</a></p>— Andrew Clark (@pssGuy) <a href="https://twitter.com/pssGuy/status/994375363219238912?ref_src=twsrc%5Etfw">May 10, 2018</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
## Totally Football and Guardian Weekly Review Podcasts {-}
<iframe width="100%" height="300" style="background-color:transparent; display:block; padding: 0; max-width: 700px;" frameborder="0" allowtransparency="allowtransparency" scrolling="no" src="//embeds.audioboom.com/posts/6854834-bad-lieutenants-ugly-town-and-extra-swazz/embed/v4?eid=AQAAAG0S-lqymGgA" title="Audioboom player"></iframe>
***
<p>
<iframe width="100%" height="300" style="background-color:transparent; display:block; padding: 0; max-width: 700px;" frameborder="0" allowtransparency="allowtransparency" scrolling="no" src="//embeds.audioboom.com/posts/6855057-wenger-gone-goal-frenzies-and-tranmere-rovers-return-football-weekly/embed/v4?eid=AQAAALwS-lqRmWgA" title="Audioboom player"></iframe>
***
## Results and Table {-}
```{r results_38}
weekly_results("2018-05-07", "2018-05-14")
```
<p>
---
```{r standings_38}
weekly_table("2018-05-14")
```
## Final Factoid {-}
<p class="factoid">Burnley's, Dwight McNeil was the only debutant on the last day - the fewest since there were none in 2011/12. He came on in the 89th minute and Bournemouth scored the winner a minute later</p>
---
## End of Season Update {-}
It's the end of the season. There aren't any!