These functions use grep to lookup information about players
(from the Master file)
and teams (from the Teams file).
Usage
playerInfo(playerID, nameFirst, nameLast, data = Lahman::Master, extra = NULL, ...)
teamInfo(teamID, name, data = Lahman::Teams, extra = NULL, ...)
Arguments
playerID
pattern for playerID
nameFirst
pattern for first name
nameLast
pattern for last name
data
The name of the dataset to search
extra
A character vector of other fields to include in the result
...
other arguments passed to grep
teamID
pattern for teamID
name
pattern for team name
Value
Returns a data frame for unique matching rows from data
Author(s)
Michael Friendly
See Also
grep, ~~~
Examples
playerInfo("aaron")
teamInfo("CH", extra="park")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Lahman)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Lahman/playerInfo.Rd_%03d_medium.png", width=480, height=480)
> ### Name: playerInfo
> ### Title: Lookup Information for Players and Teams
> ### Aliases: playerInfo teamInfo
> ### Keywords: manip
>
> ### ** Examples
>
> playerInfo("aaron")
playerID nameFirst nameLast
2 aaronha01 Hank Aaron
3 aaronto01 Tommie Aaron
>
> teamInfo("CH", extra="park")
teamID name park
2 CH1 Chicago White Stockings Union Base-Ball Grounds
33 CH2 Chicago White Stockings 23rd Street Grounds
52 CHN Chicago White Stockings 23rd Street Grounds
133 CHU Chicago/Pittsburgh (Union League) <NA>
246 CHP Chicago Pirates <NA>
388 CHA Chicago White Sox South Side Park II
599 CHF Chicago Chi-Feds Wrigley Field
>
>
>
>
>
> dev.off()
null device
1
>