Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. drive <- pbp_rp %>%
  2. group_by(game_id, posteam, drive) %>%
  3. summarize(drive_td = max(ifelse(touchdown == 1 & epa > 0,1,0)))
  4. drive <- drive %>%
  5. mutate(drive_success = mean(drive_td))
  6. drive %>%
  7. ggplot(aes(x = posteam, y = drive_success)) + geom_boxplot() +
  8. theme_minimal() +
  9. labs(title = "Drive Success 2018", caption = "data from nflscrapR")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement