| People {Lahman} | R Documentation |
People table
Description
People table - Player names, DOB, and biographical info. This file is to be used to get details
about players listed in the Batting, Pitching, and other files
where players are identified only by playerID.
Usage
data(People)
Format
A data frame with 20370 observations on the following 26 variables.
playerIDA unique code assigned to each player. The
playerIDlinks the data in this file with records on players in the other files.birthYearYear player was born
birthMonthMonth player was born
birthDayDay player was born
birthCountryCountry where player was born
birthStateState where player was born
birthCityCity where player was born
deathYearYear player died
deathMonthMonth player died
deathDayDay player died
deathCountryCountry where player died
deathStateState where player died
deathCityCity where player died
nameFirstPlayer's first name
nameLastPlayer's last name
nameGivenPlayer's given name (typically first and middle)
weightPlayer's weight in pounds
heightPlayer's height in inches
batsa factor: Player's batting hand (left (L), right (R), or both (B))
throwsa factor: Player's throwing hand (left(L) or right(R))
debutDate that player made first major league appearance
finalGameDate that player made first major league appearance (blank if still active)
retroIDID used by retrosheet, https://www.retrosheet.org/
bbrefIDID used by Baseball Reference website, https://www.baseball-reference.com/
birthDatePlayer's birthdate, in
as.DateformatdeathDatePlayer's deathdate, in
as.Dateformat
Details
debut, finalGame were converted from character strings with as.Date.
Source
Lahman, S. (2023) Lahman's Baseball Database, 1871-2022, 2022 version, https://www.seanlahman.com/baseball-archive/statistics/
Examples
data(People); data(Batting)
## add player's name to Batting data
People$name <- paste(People$nameFirst, People$nameLast, sep=" ")
batting <- merge(Batting,
People[,c("playerID","name")],
by="playerID", all.x=TRUE)
## batting and throwing
# right-handed batters are much less ambidexterous in throwing than left-handed batters
# (should only include batters)
BT <- with(People, table(bats, throws))
require(vcd)
structable(BT)
mosaic(BT, shade=TRUE)
## Who is Shoeless Joe Jackson?
subset(People, nameLast=="Jackson" & nameFirst=="Joe")
subset(People, nameLast=="Jackson" & nameFirst=="Shoeless Joe")
joeID <-c(subset(People, nameLast=="Jackson" & nameFirst=="Shoeless Joe")["playerID"])
subset(Batting, playerID==joeID)
subset(Fielding, playerID==joeID)