Description Usage Arguments Examples
This function allows a user to retrieve a boxscore of batter statistics for any game played in the PITCHf/x era (2008-current). The function takes a boxscore.xml url as it's only argument and returns boxscore data for both the home and away batters.
1 2 3 |
x |
A boxscore.xml url for a given game from the MLBAM GameDay app data. |
1 2 3 4 5 6 7 8 9 10 | # batters
url_base <- "http://gd2.mlb.com/components/game/mlb/"
url <- paste0(url_base,
"year_2016/month_05/day_21/gid_2016_05_21_milmlb_nynmlb_1/boxscore.xml")
batter_boxscore(url)
# pitchers
url_base <- "http://gd2.mlb.com/components/game/mlb/"
url <- paste0(url_base,
"year_2016/month_05/day_21/gid_2016_05_21_milmlb_nynmlb_1/boxscore.xml")
pitcher_boxscore(url)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.