Learn R Programming

baseballr (version 0.8.6)

pitcher_boxscore: Retrieve pitcher boxscore data for a single game played

Description

This function allows a user to retrieve a boxscore of pitcher 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

pitcher_boxscore(x)

Arguments

x

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

Examples

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

Run the code above in your browser using DataLab