Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### --- Load pacakges (if necessary) --- ###
- library(dplyr, warn.conflicts = FALSE)
- library(ggplot2)
- library(xtable)
- library(descr)
- ### --- Total number of pitches thrown during each game in 2013 --- ###
- pfx_16 %>%
- group_by(gameday_link) %>%
- summarize(N = length(call))
- pfx_16 %>%
- group_by(gameday_link) %>%
- summarize(N = length(call)) %>%
- summarize(min = min(N), max = max(N), mean = mean(N), sd = sd(N))
- ### --- Mean/SD number of pitches per game in 2013 --- ###
- msd_pitches <- pfx_16 %>%
- group_by(gameday_link) %>%
- summarize(N = length(call)) %>%
- summarize(mean = mean(N), sd = sd(N))
- ### --- Mean/SD number of decisions per game in 2013 --- ###
- msd_decisions <- pfx_16 %>%
- group_by(gameday_link) %>%
- filter(call == "Called Strike" | call == "Ball") %>%
- summarize(N = length(call)) %>%
- summarize(min = min(N), max = max(N), mean = mean(N), sd = sd(N))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement