-
Notifications
You must be signed in to change notification settings - Fork 0
/
30-week_30.Rmd
266 lines (171 loc) · 8.52 KB
/
30-week_30.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
# Week 30 {-}
Rashford schools Alex-Arnold.
A third consecutive one-goal loss to a top 6 team means that Palace
will be relying on their easy run in to get back out of the bottom three
***
<p class="factoid">Palace joined WBA with a league-leading ninth one-goal defeat. Every team has suffered at least one such occurrence this season. Surprisingly Huddersfield have lost by a single goal just once in their 15 defeats</p>
***
## Manager changes {-}
Several teams have changed manager's this season in an attempt to acquire a 'New manger Bounce'. Whether, or not,this concept has any validity (Managers are usually sacked after a bad run and some reversion to mean performance would be expected if they stayed) there has certainly been some significant variation in outcome
Other than Southampton - who may stll decide to take the plunge - and the promoted clubs, all those teams currently in most imminent danger have called in a new guy.
Here are their records
```{r managers_30}
# teams that have changed managers during season
changeTeams <- managers %>%
filter(Joined > "2017-08-10") %>%
pull(TEAMNAME) %>%
unique()
allManagerStints <-
managerGame %>%
select(name, ManagerTeam, Joined, Left) %>%
unique()
temp <- managerGame %>%
filter(gameDate > "2017-08-01" & TEAMNAME %in% changeTeams) %>%
group_by(TEAMNAME, ManagerID, ManagerTeam, name) %>%
dplyr::summarise(
sumPoints = sum(points),
games = n(),
ppg = round(sumPoints / games, 2)
) %>%
ungroup()
## unsworth is in their twice error in raw material
## temp just gives summary not game duration
teamRecord <- temp %>%
inner_join(allManagerStints) %>%
mutate(started = ifelse(
Joined < "2017-08-10",
as.Date("2017-08-10", origin = "1900-01-01"),
as.Date(Joined, origin = "1900-01-01")
)) %>%
mutate(st = as.Date(started, origin = "1970-01-01"))
# hack but looks good hrbrmisc may proves usefurl - or lubridate
minY <- min(teamRecord$ppg) - 0.1
maxY <- max(teamRecord$ppg) + 0.1
plot_ly(teamRecord, color = ~ TEAMNAME) %>%
add_segments(
x = ~ st,
xend = ~ Left,
y = ~ ppg,
yend = ~ ppg,
hoverinfo = "text",
text = ~ paste0(name,
"<br>", TEAMNAME,
"<br>Games:", games,
"<br>ppg:", ppg)
) %>%
layout(
title = "Average Points per Game by Manager 2017/18",
xaxis = list(title = ""),
yaxis = list(title = "Points per Game")
) %>% config(displayModeBar = F, showLink = F)
```
Double-Click on the team name to isolate just their data. The short segments (barring de Boer at Crustal Palace) represent caretakers
Other than WBA - where Alan Pardew's managerial career in the Premier League looks set to end - there have been some improvement; though Stoke's is marginal and may not suffice to save them
## Super Subs {-}
Burnley have proved this season's good-news story and after a sticky spell are again pushing for a Europa spot. One reason has been the form of new-purchase, Chris Wood, and he came on as a sub, Saturday, to set up the first goal and score two others. Three points in a game for a sub is a pretty rare event - occurring on average just more than once per season
```{r super_subs_30}
playerGame %>%
filter(subOn > 0 & (Gls + Assists) > 2) %>%
select(name, TEAMNAME, season, gameDate, Assists, Gls, mins) %>%
arrange(desc(gameDate)) %>%
select(
player = name,
team = TEAMNAME,
season,
date = gameDate,
Goals = Gls,
Assists,
mins = mins
) %>%
DT::datatable(
class = 'compact stripe hover row-border order-column',
rownames = FALSE,
options = list(
paging = TRUE,
searching = TRUE,
info = FALSE
)
)
```
_N.B. Unlike official statistics, I allow up to two assists per goal_
Oscar and David Beckham, feature twice
Stand-out performances include Solskjaer's four goals in 22 minutes and
Wigan;s Amr Zaki who pitched in 2 goals and an assist in just 6 minutes in a game versus Hull - a team he subsequently played for without scoring or assisting on a single goal
---
## Tweet of the Week {-}
<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr"><a href="https://twitter.com/hashtag/WHUFC?src=hash&ref_src=twsrc%5Etfw">#WHUFC</a> get beaten by three clear goals, third game on trot. Only ever happened 10 times in <a href="https://twitter.com/hashtag/premierleague?src=hash&ref_src=twsrc%5Etfw">#premierleague</a>. Exactly a decade ago, the Hammers lost consecutive games 0-4 to <a href="https://twitter.com/hashtag/CFC?src=hash&ref_src=twsrc%5Etfw">#CFC</a> <a href="https://twitter.com/hashtag/LFC?src=hash&ref_src=twsrc%5Etfw">#LFC</a> and <a href="https://twitter.com/hashtag/THFC?src=hash&ref_src=twsrc%5Etfw">#THFC</a> <a href="https://t.co/092CjHsHBg">pic.twitter.com/092CjHsHBg</a></p>— Andrew Clark (@pssGuy) <a href="https://twitter.com/pssGuy/status/973146759135481856?ref_src=twsrc%5Etfw">March 12, 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/6718931-toxicity-complicity-and-pitchside-relief/embed/v4?eid=AQAAAM4NqFrThWYA" 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/6719096-did-upton-park-die-for-this-football-weekly/embed/v4?eid=AQAAAJwNqFp4hmYA" title="Audioboom player"></iframe>
***
## Results and Table {-}
```{r results_30}
weekly_results("2018-03-06","2018-03-13")
```
<p>
---
```{r standings_30}
weekly_table("2018-03-13")
```
## Final Factoid {-}
<p class="factoid">West Ham suffer three consecutive defeats by 3 goals exactly ten years since they lost 3 games on the trot 0-4</p>
---
## End of Season Update {-}
In the end, Huddersfield did lose a couple of other games by the odd goal, 0-1 to both Newcastle and Arsenal, but the distribution still looks odd
```{r}
standings %>%
filter(season == "2017/18",team=="Huddersfield") %>%
mutate(GD = GF - GA) %>%
plot_ly(x = ~ GD) %>%
add_histogram(color = I("yellow")) %>%
layout(xaxis=list(title="Goal Difference"),
yaxis=list(title="Number of Games")) %>% config(displayModeBar = F, showLink = F)
```
Excluding Huddersfield, defeated teams lost by 1 goal 50% of the time. Newcastle and Swansea ended up with most single game defeats,12.
---
#### Manager changes {-}
In most seasons 38 points, a point a game, is enough to stay up, but teams worried about relegation and swapping managers are often in a worse situation and will expect more.
Mark Hughes, at Southampton, walked off with a big cheque and praise as a 'ggod fit' for an extension in spite of his ppg being only marginally better than his predecessor
With a far weaker squad, Carvahal, at Swansea, proved far superior in the long run. Unfrotunately it was the dhort run of 5 defeats in a row and relegation that counts
#### Super Subs {-}
Here is the attacking impact of subs this season, by club
The 'ppg' column is an estimated per 90 minutes (but may be overstated as extra time is not included in the minutes accrued figure)
```{r super_subsu_30}
playerGame %>%
filter(subOn > 0, season == "2017/18") %>%
group_by(TEAMNAME) %>%
summarize(
totG = sum(Gls),
totA = sum(Assists),
totP = totG + totA,
totM = sum(mins),
ppg = round(100 * totP / totM, 2)
) %>%
arrange(desc(totP)) %>%
select(
team = TEAMNAME,
goals = totG,
assists = totA,
points = totP,
mins = totM,
ppg
) %>%
DT::datatable(
class = 'compact stripe hover row-border order-column',
rownames = FALSE,
options = list(
paging = TRUE,
searching = TRUE,
info = FALSE
)
)
```
At Watford, Pereyra and Deeney have been particularly impactful, with Wood and Vokes contributing significantly at Burnley.
Tottenham trail the other top clubs, with only single strikes from Wanyama and Sissoko providing goals from off the bench
---
The Burnley defeat may have been the end of West Ham's big losses but by the end of the year they had suffered 10 three goal or larger losses, matching the 38 game season record of Derby County in 2007/08
## Code Hints {-}
* plotly - add_segments()