Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drive <- pbp_rp %>%
- group_by(game_id, posteam, drive) %>%
- summarize(drive_td = max(ifelse(touchdown == 1 & epa > 0,1,0)))
- drive <- drive %>%
- mutate(drive_success = mean(drive_td))
- drive %>%
- ggplot(aes(x = posteam, y = drive_success)) + geom_boxplot() +
- theme_minimal() +
- labs(title = "Drive Success 2018", caption = "data from nflscrapR")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement