Learn R Programming

baseballr (version 0.8.6)

batter_boxscore: Retrieve batter boxscore data for a single game played

Description

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.

Usage

batter_boxscore(x)

Arguments

x

A boxscore.xml url for a given game from the MLBAM GameDay app data.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab