This function allows you to create statlines of statistics for players or groups of players from raw Statcast or PITCHf/x data. When calculating wOBA, the most recent year in the data frame is used for weighting.
statline_from_statcast(df, base = "pa")
A data frame of statistics that includes, at a minimum, the following columns: events, description, game_date, and type.
Tells the function what to use as the population of pitches to use for the statline. Options include "swings", "contact", or "pa". Defaults to "pa".
# NOT RUN {
statline_from_statcast(df, base = "contact")
# }
Run the code above in your browser using DataLab