playerInfo {Lahman}R Documentation

Lookup Information for Players and Teams

Description

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 = Master, extra = NULL, ...)

teamInfo(teamID, name, data = 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")
##    playerID nameFirst nameLast
## 1 aaronha01      Hank    Aaron
## 2 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
## 149    CHU Chicago/Pittsburgh (Union League)                    <NA>
## 258    CHP                   Chicago Pirates                    <NA>
## 386    CHA                 Chicago White Sox      South Side Park II
## 603    CHF                  Chicago Chi-Feds           Wrigley Field


[Package Lahman version 2.0-1 Index]