-
Notifications
You must be signed in to change notification settings - Fork 0
/
13-week_13.Rmd
295 lines (184 loc) · 9.11 KB
/
13-week_13.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
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
# Week 13 {-}
The one top-six clash ended in stalemate leaving both Liverpool and Chelsea even further behind the Manchester clubs. Everton already have a Goal Difference of -15, their worst at any stage of a season since 2005/06
***
## Schedule difficulty {-}
In spite of the season now more than a third gone, there remain some significant differences in terms of quality of opposition faced so far (based on finishing position last year)
```{r schedule_13}
## last year's returning teams by position
old <- standings %>%
filter(season == "2016/17" & tmYrGameOrder == 1) %>%
select(position = final_Pos, team) %>%
filter(position < 18)
# promoted clubs filling the bottom three spots - again by how they finished in Championship
new <-
data.frame(
team = c("Newcastle U", "Brighton", "Huddersfield"),
position = c(18, 19, 20)
)
all <- bind_rows(old, new)
myFun <- function(x) {
# need to remove selected team from the table and re-order
change <- all %>%
filter(team != x) %>%
mutate(order = row_number())
# apply team's schedule to date
standings %>%
filter(season == "2017/18" & team == x & tmYrGameOrder <= 13) %>%
select(OppTeam) %>%
left_join(change, by = c("OppTeam" = "team")) %>%
summarise(diff = mean(order)) %>%
pull(diff)
}
# map across allteasm
difficulty = map_dbl(all$team, myFun)
df <- data.frame(team = all$team, difficulty = difficulty)
df %>%
arrange(difficulty) %>%
select(`Most difficult` = team) %>%
DT::datatable(
class = 'compact stripe hover row-border order-column',
rownames = TRUE,
options = list(
paging = TRUE,
searching = FALSE,
info = FALSE,
pageLength = 10
),
width = 300,
height = 700
)
```
Chelsea have had the hardest run to date and still have to face Swansea(H), Newcastle(H), West Ham(A), Huddersfield(A), Southampton(H) and Everton(A). You would have to think they would be disappointed with anything less than 15 points
Southampton's by contrast have Man City(A), Bournemouth(A), Arsenal(H), Leicester(H), Chelsea(A) and Huddersfield(H). The win over Everton will have given them a timely boost
***
<p class="factoid">In 29 starts with Sunderland last year, Jordan Pickford conceded an average of 1.72 goals per game. So far with Everton, it has been 2.15</p>
***
## So close for Burnley {-}
Another controversial extra-time victory for Arsenal over Burnley has denied the Clarets from keeping four consecutive clean sheets in the EPL for the first time
They have to settle for equalling their best ever
```{r shutouts_13}
burnley <- standings %>%
filter(team == "Burnley") %>%
arrange(gameDate)
counts = roll_sum(burnley$GA, n = 4)
data.frame(goals = counts) %>%
mutate(order = row_number()) %>%
plot_ly(x = ~ order, y = ~ goals) %>%
add_lines() %>%
layout(
title = "Goals Conceded in 4 game-stretches - Burnley",
xaxis = list(title = "Game Order"),
yaxis = list(title = "Goals Against")
) %>% config(displayModeBar = F, showLink = F)
```
***
<p class="factoid">Only one team conceding more than an average of 2 goals a season has avoided relegation - Wigan 16th 2009/10. Other than Everton (see above). Stoke and West Ham are currently on the button </p>
***
***
## Tweet of the Week {-}
<blockquote class="twitter-tweet" data-lang="en"><p lang="sl" dir="ltr">Pogba > de Bruyne. Big claim from <a href="https://twitter.com/jackaustin_1?ref_src=twsrc%5Etfw">@jackaustin_1</a> @ Independent <a href="https://t.co/hmPJ8KdFfx">https://t.co/hmPJ8KdFfx</a> <br>v other top six Pobga 1assist(inc secondary) 0 gls. de B 6&10<a href="https://t.co/5dQ5BrYsv5">https://t.co/5dQ5BrYsv5</a> <a href="https://twitter.com/hashtag/MUFC?src=hash&ref_src=twsrc%5Etfw">#MUFC</a> <a href="https://twitter.com/hashtag/MCFC?src=hash&ref_src=twsrc%5Etfw">#MCFC</a> <a href="https://t.co/W7Wy9jBEvo">pic.twitter.com/W7Wy9jBEvo</a></p>— Andrew Clark (@pssGuy) <a href="https://twitter.com/pssGuy/status/933768157054955520?ref_src=twsrc%5Etfw">November 23, 2017</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/6502679-pulis-p45-ed-narrative-busters-and-dulwich-hamlet-s-toilets-opposite-stand/embed/v4?eid=AQAAACyCE1oXOWMA" title="audioBoom player"></iframe>
<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/6518587-shambolic-everton-manchester-city-s-marvels-and-dyche-s-deep-thinking-football-weekly/embed/v4?eid=AQAAAN1qHFo7d2MA" title="audioBoom player"></iframe>
***
## Results and Table {-}
```{r results_13}
weekly_results("2017-11-21","2017-11-27")
```
```{r standings_13}
weekly_table("2017-11-27")
```
## Final Factoid {-}
<p class="factoid">Man City already look safe from relegation with 37 points. Only eight of the 66 teams relegated under the 38 game season with 38+ points have failed to survive</p>
---
## End of Season Update {-}
#### Schedule difficulty {-}
Chelsea actually picked up 13 points with defeat at West Ham and a draw with Everton. True to expectations, Southampton mustered just 3 draws in the six games (which comprised the first half of a 12 match winless run) and were only three points clear of the bottom three by the half way mark of the campaign and were ..
Here is how many points every team did in rounds 13-19 relative to the toughness of games, as measured by 2016/17 finishing position
```{r }
old <- standings %>%
filter(season == "2016/17" & tmYrGameOrder == 1) %>%
select(position = final_Pos, team) %>%
filter(position < 18)
# promoted clubs filling the bottom three spots - again by how they finished in Championship
new <-
data.frame(
team = c("Newcastle U", "Brighton", "Huddersfield"),
position = c(18, 19, 20)
)
all <- bind_rows(old, new)
myFun <- function(x) {
# need to remove selected team from the table and re-order
change <- all %>%
filter(team != x) %>%
mutate(order = row_number())
# apply team's schedule to date
standings %>%
filter(season == "2017/18" & team == x & tmYrGameOrder <= 13) %>%
select(OppTeam) %>%
left_join(change, by = c("OppTeam" = "team")) %>%
summarise(diff = mean(order)) %>%
pull(diff)
}
# map across allteasm
difficulty = map_dbl(all$team, myFun)
easy <- data.frame(team = all$team, difficulty = difficulty) %>%
arrange(difficulty) %>%
mutate(difficulty = row_number())
# standings at week 13
wk13 <- standings %>%
filter(season == "2017/18" & tmYrGameOrder == 13) %>%
select(team, cum_13 = cumPts)
standings %>%
filter(season == "2017/18" & tmYrGameOrder == 19) %>%
select(team, cum_19 = cumPts) %>%
inner_join(wk13) %>%
mutate(diff = cum_19 - cum_13) %>%
inner_join(easy) %>%
plot_ly(x = ~ difficulty, y = ~ diff) %>%
add_markers(hoverinfo = "text",
text = ~ team) %>%
layout(
title = "Points Gained Rounds 14-19 by Schedule Difficulty ",
xaxis = list(title = "Schedule Difficulty"),
yaxis = list(title = "Points Gained")
) %>% config(displayModeBar = F, showLink = F)
```
There is a clear relationship to be seen. Teams that performed out of the ordinary would include, surprise-surprise, Manchester City. They picked up maximum points in spite of facing
both Manchester United an Tottenham. Watford, in contrast under-performed culminating in succesive defeats to newly promoted clubs, Huddersfield and Brighton
---
As some veteran defenders in Jageilka, Baines and Coleman returned Pickford ended up conceding just 1.52 per game and becoming England's number one choice. He was one of only ten players to play every minute of the season
---
#### So close for Burnley {-}
As can be seen from the chart, Burnley's defence earned the praise it has been given, particularly at the start of the campaign
Teams that did manage four game shutout runs this season
```{r shutoutsu_13}
clubs <- standings %>%
filter(season == "2017/18") %>%
pull(team) %>%
unique()
games <- standings %>%
filter(season == "2017/18") %>%
arrange(gameDate)
shutouts <- function(club) {
goalsAg <- games %>%
filter(team == club) %>%
pull(GA)
x <- data.frame(counts = roll_sum(goalsAg, n = 4))
x$team <- club
x
}
res <- map_df(clubs, shutouts)
res %>%
filter(counts == 0) %>%
pull(team) %>%
unique()
```
The one surprise on the list is Arsenal, who, in total, conceded 12 more than Burnley. However, the run came early in the season and included home games versus Bournemouth, West Brom and Brighton as well a, more impressive, 0-0 draw at Chelsea.
---
In the end, no team conceded close to an average of two goals a game. Stoke and West Ham (featuring two England gpalkeepers) were closest with hust 68 against, the fewest for a worst-placed side since WBA's 67 in 2008/09
---
## Code Hints {-}
* RcppRoll - roll_sum