Lahman: Sean Lahman's Baseball Database

野球データ

> library(Lahman)
> data("Salaries")
> data("Schools")
> data("SeriesPost")
> data("Teams")
> data("TeamsHalf")
> data("TeamsFranchises")
> data("battingLabels")

バージョン: 4.0.1


関数名 概略
AllstarFull AllstarFull table
Appearances Appearances table
AwardsManagers AwardsManagers table
AwardsPlayers AwardsPlayers table
AwardsShareManagers AwardsShareManagers table
AwardsSharePlayers AwardsSharePlayers table
Batting Batting table
BattingPost BattingPost table
CollegePlaying CollegePlaying table
Fielding Fielding table
FieldingOF FieldingOF table
FieldingPost FieldingPost data
HallOfFame Hall of Fame Voting Data
Label Extract the Label for a Variable
Lahman-package Sean Lahman's Baseball Database
LahmanData Lahman Datasets
Managers Managers table
ManagersHalf ManagersHalf table
Master Master table
Pitching Pitching table
PitchingPost PitchingPost table
Salaries Salaries table
Schools Schools table
SeriesPost SeriesPost table
Teams Teams table
TeamsFranchises TeamFranchises table
TeamsHalf TeamsHalf table
battingLabels Variable Labels
battingStats Calculcate additional batting statistics
playerInfo Lookup Information for Players and Teams

AllstarFull

> AllstarFull %>% {
+   class(.) %>% print()
+   dplyr::glimpse(.)
+ }
[1] "data.frame"
Observations: 4,993
Variables: 8
$ playerID    (chr) "gomezle01", "ferreri01", "gehrilo01", "gehrich01"...
$ yearID      (int) 1933, 1933, 1933, 1933, 1933, 1933, 1933, 1933, 19...
$ gameNum     (int) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
$ gameID      (chr) "ALS193307060", "ALS193307060", "ALS193307060", "A...
$ teamID      (fctr) NYA, BOS, NYA, DET, CHA, WS1, NYA, CHA, NYA, CLE,...
$ lgID        (fctr) AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, A...
$ GP          (int) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0,...
$ startingPos (int) 1, 2, 3, 4, 5, 6, 7, 8, 9, NA, NA, NA, NA, NA, NA,...

Pitching

> data("Pitching")
> Pitching %>% dplyr::glimpse()
Observations: 43,330
Variables: 30
$ playerID (chr) "bechtge01", "brainas01", "fergubo01", "fishech01", "...
$ yearID   (int) 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871,...
$ stint    (int) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,...
$ teamID   (fctr) PH1, WS3, NY2, RC1, NY2, TRO, RC1, FW1, PH1, TRO, PH...
$ lgID     (fctr) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ...
$ W        (int) 1, 12, 0, 4, 0, 0, 0, 6, 18, 12, 0, 0, 1, 10, 19, 2, ...
$ L        (int) 2, 15, 0, 16, 1, 0, 1, 11, 5, 15, 0, 2, 0, 17, 10, 0,...
$ G        (int) 3, 30, 1, 24, 1, 1, 3, 19, 25, 29, 1, 7, 3, 28, 31, 2...
$ GS       (int) 3, 30, 0, 24, 1, 0, 1, 19, 25, 29, 0, 1, 0, 28, 31, 2...
$ CG       (int) 2, 30, 0, 22, 1, 0, 1, 19, 25, 28, 0, 1, 0, 22, 22, 2...
$ SHO      (int) 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0,...
$ SV       (int) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 3,...
$ IPouts   (int) 78, 792, 3, 639, 27, 3, 39, 507, 666, 747, 3, 88, 31,...
$ H        (int) 43, 361, 8, 295, 20, 1, 20, 261, 285, 430, 1, 50, 10,...
$ ER       (int) 23, 132, 3, 103, 10, 0, 5, 97, 113, 153, 1, 22, 4, 94...
$ HR       (int) 0, 4, 0, 3, 0, 0, 0, 5, 3, 4, 0, 4, 0, 9, 2, 0, 7, 0,...
$ BB       (int) 11, 37, 0, 31, 3, 0, 3, 21, 40, 75, 2, 6, 3, 47, 38, ...
$ SO       (int) 1, 13, 0, 15, 0, 0, 1, 17, 15, 12, 0, 0, 0, 34, 23, 0...
$ BAOpp    (dbl) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ ERA      (dbl) 7.96, 4.50, 27.00, 4.35, 10.00, 0.00, 3.46, 5.17, 4.5...
$ IBB      (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ WP       (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ HBP      (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ BK       (int) 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
$ BFP      (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ GF       (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ R        (int) 42, 292, 9, 257, 21, 0, 30, 243, 223, 362, 1, 53, 8, ...
$ SH       (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ SF       (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...
$ GIDP     (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N...

Salaries

> data("Salaries")
> Salaries %>% dplyr::glimpse()
Observations: 24,758
Variables: 5
$ yearID   (int) 1985, 1985, 1985, 1985, 1985, 1985, 1985, 1985, 1985,...
$ teamID   (fctr) ATL, ATL, ATL, ATL, ATL, ATL, ATL, ATL, ATL, ATL, AT...
$ lgID     (fctr) NL, NL, NL, NL, NL, NL, NL, NL, NL, NL, NL, NL, NL, ...
$ playerID (chr) "barkele01", "bedrost01", "benedbr01", "campri01", "c...
$ salary   (int) 870000, 550000, 545000, 633333, 625000, 800000, 15000...

Schools

> data("Schools")
> Schools %>% dplyr::glimpse()
Observations: 1,207
Variables: 5
$ schoolID  (chr) "abilchrist", "adelphi", "adrianmi", "akron", "alaba...
$ name_full (chr) "Abilene Christian University", "Adelphi University"...
$ city      (chr) "Abilene", "Garden City", "Adrian", "Akron", "Tuscal...
$ state     (chr) "TX", "NY", "MI", "OH", "AL", "AL", "AL", "GA", "ID"...
$ country   (chr) "USA", "USA", "USA", "USA", "USA", "USA", "USA", "US...

SeriesPost

> data("SeriesPost")
> SeriesPost %>% dplyr::glimpse()
Observations: 298
Variables: 9
$ yearID       (int) 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1892, 1...
$ round        (chr) "WS", "WS", "WS", "WS", "WS", "WS", "WS", "CS", "...
$ teamIDwinner (fctr) PRO, CHC, STL, DTN, NYG, NYG, BRO, BSN, BOS, NY1...
$ lgIDwinner   (fctr) NL, NL, AA, NL, NL, NL, NL, NL, AL, NL, AL, NL, ...
$ teamIDloser  (fctr) NYP, STL, CHC, STL, STL, BRO, LOU, CLV, PIT, PHA...
$ lgIDloser    (fctr) AA, AA, NL, AA, AA, AA, AA, NL, NL, AL, NL, AL, ...
$ wins         (int) 3, 3, 4, 10, 6, 6, 3, 5, 5, 4, 4, 4, 4, 4, 4, 4, ...
$ losses       (int) 0, 3, 2, 5, 4, 3, 3, 0, 3, 1, 2, 0, 1, 3, 1, 2, 3...
$ ties         (int) 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...

Teams

> data("Teams")
> Teams %>% dplyr::glimpse()
Observations: 2,775
Variables: 48
$ yearID         (int) 1871, 1871, 1871, 1871, 1871, 1871, 1871, 1871,...
$ lgID           (fctr) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA...
$ teamID         (fctr) BS1, CH1, CL1, FW1, NY2, PH1, RC1, TRO, WS3, B...
$ franchID       (fctr) BNA, CNA, CFC, KEK, NNA, PNA, ROK, TRO, OLY, B...
$ divID          (chr) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ Rank           (int) 3, 2, 8, 7, 5, 1, 9, 6, 4, 2, 9, 6, 1, 7, 8, 3,...
$ G              (int) 31, 28, 29, 19, 33, 28, 25, 29, 32, 58, 29, 37,...
$ Ghome          (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ W              (int) 20, 19, 10, 7, 16, 21, 4, 13, 15, 35, 3, 9, 39,...
$ L              (int) 10, 9, 19, 12, 17, 7, 21, 15, 15, 19, 26, 28, 8...
$ DivWin         (chr) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ WCWin          (chr) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ LgWin          (chr) "N", "N", "N", "N", "N", "Y", "N", "N", "N", "N...
$ WSWin          (chr) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ R              (int) 401, 302, 249, 137, 302, 376, 231, 351, 310, 61...
$ AB             (int) 1372, 1196, 1186, 746, 1404, 1281, 1036, 1248, ...
$ H              (int) 426, 323, 328, 178, 403, 410, 274, 384, 375, 74...
$ X2B            (int) 70, 52, 35, 19, 43, 66, 44, 51, 54, 94, 26, 46,...
$ X3B            (int) 37, 21, 40, 8, 21, 27, 25, 34, 26, 35, 6, 10, 3...
$ HR             (int) 3, 10, 7, 2, 1, 9, 3, 6, 6, 14, 0, 0, 7, 0, 1, ...
$ BB             (int) 60, 60, 26, 33, 33, 46, 38, 49, 48, 27, 14, 19,...
$ SO             (int) 19, 22, 25, 9, 15, 23, 30, 19, 13, 28, 29, 24, ...
$ SB             (int) 73, 69, 18, 16, 46, 56, 53, 62, 48, 35, 8, 17, ...
$ CS             (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, 15, 4, 14, ...
$ HBP            (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ SF             (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ RA             (int) 303, 241, 341, 243, 313, 266, 287, 362, 303, 43...
$ ER             (int) 109, 77, 116, 97, 121, 137, 108, 153, 137, 173,...
$ ERA            (dbl) 3.55, 2.76, 4.11, 5.17, 3.72, 4.95, 4.30, 5.51,...
$ CG             (int) 22, 25, 23, 19, 32, 27, 23, 28, 32, 48, 28, 37,...
$ SHO            (int) 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 3, 0, 0, 3,...
$ SV             (int) 3, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0,...
$ IPouts         (int) 828, 753, 762, 507, 879, 747, 678, 750, 846, 15...
$ HA             (int) 367, 308, 346, 261, 373, 329, 315, 431, 371, 56...
$ HRA            (int) 2, 6, 13, 5, 7, 3, 3, 4, 4, 3, 6, 6, 0, 6, 5, 2...
$ BBA            (int) 42, 28, 53, 21, 42, 53, 34, 75, 45, 63, 24, 19,...
$ SOA            (int) 23, 22, 34, 17, 22, 16, 16, 12, 13, 0, 0, 0, 0,...
$ E              (int) 225, 218, 223, 163, 227, 194, 220, 198, 217, 43...
$ DP             (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ FP             (dbl) 0.83, 0.82, 0.81, 0.80, 0.83, 0.84, 0.82, 0.84,...
$ name           (chr) "Boston Red Stockings", "Chicago White Stocking...
$ park           (chr) "South End Grounds I", "Union Base-Ball Grounds...
$ attendance     (int) NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,...
$ BPF            (int) 103, 104, 96, 101, 90, 102, 97, 101, 94, 106, 8...
$ PPF            (int) 98, 102, 100, 107, 88, 98, 99, 100, 98, 102, 96...
$ teamIDBR       (chr) "BOS", "CHI", "CLE", "KEK", "NYU", "ATH", "ROK"...
$ teamIDlahman45 (chr) "BS1", "CH1", "CL1", "FW1", "NY2", "PH1", "RC1"...
$ teamIDretro    (chr) "BS1", "CH1", "CL1", "FW1", "NY2", "PH1", "RC1"...

TeamsFranchises

> data("TeamsFranchises")
> TeamsFranchises %>% dplyr::glimpse()
Observations: 120
Variables: 4
$ franchID   (fctr) ALT, ANA, ARI, ATH, ATL, BAL, BFB, BFL, BLC, BLO, ...
$ franchName (chr) "Altoona Mountain City", "Los Angeles Angels of Ana...
$ active     (chr) "N", "Y", "Y", "N", "Y", "Y", "N", "N", "NA", "N", ...
$ NAassoc    (chr) NA, NA, NA, "PNA", "BNA", NA, NA, NA, NA, NA, NA, N...

TeamsHalf

> data("TeamsHalf")
> TeamsHalf %>% dplyr::glimpse()
Observations: 52
Variables: 10
$ yearID (int) 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1981, 1...
$ lgID   (fctr) NL, NL, AL, AL, AL, AL, AL, AL, AL, AL, NL, NL, NL, NL...
$ teamID (fctr) ATL, ATL, BAL, BAL, BOS, BOS, CAL, CAL, CHA, CHA, CHN,...
$ Half   (int) 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1...
$ divID  (chr) "W", "W", "E", "E", "E", "E", "W", "W", "W", "W", "E", ...
$ DivWin (chr) "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", ...
$ Rank   (int) 4, 5, 2, 4, 5, 2, 4, 6, 3, 6, 6, 5, 2, 2, 6, 5, 4, 2, 3...
$ G      (int) 54, 52, 54, 51, 56, 52, 60, 50, 53, 53, 52, 51, 56, 52,...
$ W      (int) 25, 25, 31, 28, 30, 29, 31, 20, 31, 23, 15, 23, 35, 31,...
$ L      (int) 29, 27, 23, 23, 26, 23, 29, 30, 22, 30, 37, 28, 21, 21,...

battingLabels

> data("battingLabels")
> battingLabels %>% dplyr::glimpse()
Observations: 22
Variables: 2
$ variable (chr) "playerID", "yearID", "stint", "teamID", "lgID", "G",...
$ label    (chr) "Player ID code", "Year", "Player's stint", "Team", "...

battingStats

> battingStats %>% class()
[1] "function"

playerInfo

Arguments

  • playerID
  • nameFirst
  • nameLast
  • data
  • extra
  • ...
  • teamID
  • name
> playerInfo("aaron")
   playerID nameFirst nameLast
2 aaronha01      Hank    Aaron
3 aaronto01    Tommie    Aaron