Learn R Programming

baseballr (version 0.8.6)

get_retrosheet_data: Get, Parse, and Format Retrosheet Event and Roster Files

Description

Get, Parse, and Format Retrosheet Event and Roster Files

Usage

get_retrosheet_data(
  path_to_directory,
  years_to_acquire = 2018,
  sequence_years = FALSE
)

Arguments

path_to_directory

A file path that either 1) creates a new directory or 2) a path to an existing directory

years_to_acquire

The sesons to collect. Single, multiple, and sequential years can be passed. If passing multiple years, encolse in a vector (i.e. c(2017,2018)). Defaults to 2018.

sequence_years

If the seasons passed in the years_to_acquire paramter should be sequenced so that the function returns all years including and between the vector passed, set the argument to TRUE. Defaults to FALSE.

Value

Returns two csv files to the unzipped directory: 1) a combined csv of the event data for a given year and 2) a combined csv of each team's roster for each year

Examples

Run this code
# NOT RUN {
get_retrosheet_data(path_to_directory = "/Users/Documents/retrosheet/", years_to_acquire = c(1957,1959), sequence_years = F)
# }

Run the code above in your browser using DataLab