powered by
These functions use grep to lookup information about players (from the People file) and teams (from the Teams file).
grep
People
Teams
playerInfo(playerID, nameFirst, nameLast, data = Lahman::People, extra = NULL, ...)teamInfo(teamID, name, data = Lahman::Teams, extra = NULL, ...)
teamInfo(teamID, name, data = Lahman::Teams, extra = NULL, ...)
Returns a data frame for unique matching rows from data
data
pattern for playerID
playerID
pattern for first name
pattern for last name
The name of the dataset to search
A character vector of other fields to include in the result
other arguments passed to grep
pattern for teamID
teamID
pattern for team name
Michael Friendly
grep, ~~~
playerInfo("aaron") teamInfo("CH", extra="park")
Run the code above in your browser using DataLab