Learn R Programming

retrosheet (version 1.0.2)

getTeamIDs: Retrieve team IDs for event files

Description

This function retrieves the team ID needed for the team argument of getRetrosheet("play", year, team).

Usage

getTeamIDs(year, quiet = TRUE, ...)

Arguments

year
A single valid four-digit numeric year.
quiet
logical. Passed to download.file
...
further arguments passed to download.file.

Value

If the file exists, a named vector of IDs for the given year. Otherwise NA.

Details

All currently available years can be retrieved with type.convert(substr(getFileNames()$event, 1L, 4L))

Examples

Run this code
getTeamIDs(2010)

Run the code above in your browser using DataLab