Learn R Programming

retrosheet (version 1.1.6)

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)

Value

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

Arguments

year

A single valid four-digit numeric year.

Details

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

Examples

Run this code
# \donttest{
getTeamIDs(2010)
# }

Run the code above in your browser using DataLab