Description Usage Value Examples
Gets primary position based on 'Fielding' table from the 'Lahman' package. Uses the categories from the Lahman Fielding table so all OF positons are collapsed into 'OF'. Main use is to filter pitchers before computing seasonal averages batting stats.
1 | get_primary_pos(year = NULL)
|
A data frame containing playerID, yearID, primary position, and number of games at primary position.
1 2 | primary_pos <- get_primary_pos()
primary_pos %>% group_by(POS) %>% summarise(n=n())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.