
SeriesPost table
SeriesPost.RdPost season series information
Usage
data(SeriesPost)Format
A data frame with 440 observations on the following 9 variables.
yearIDYear
roundLevel of playoffs
teamIDwinnerTeam ID of the team that won the series; a factor
lgIDwinnerLeague ID of the team that won the series; a factor with levels
ALNLteamIDloserTeam ID of the team that lost the series; a factor
lgIDloserLeague ID of the team that lost the series; a factor with levels
ALNLwinsWins by team that won the series
lossesLosses by team that won the series
tiesTie games
Source
Lahman, S. (2026) Lahman's Baseball Database, 1871-2025, 2026 version, https://sabr.org/lahman-database/
Examples
data(SeriesPost)
# How many times has each team won the World Series?
# Notes:
# - the SeriesPost table includes an identifier for the
# team (teamID), but not the franchise (e.g. the Brooklyn Dodgers
# [BRO] and Los Angeles Dodgers [LAN] are counted separately)
#
# - the World Series was first played in 1903, but the
# Lahman data tables have the final round of the earlier
# playoffs labelled "WS", so it is necessary to
# filter the SeriesPost table to exclude years prior to 1903.
# using the dplyr data manipulation package
library("dplyr")
library("tidyr")
library("ggplot2")
## WS winners, arranged in descending order of titles won
ws_winner_table <- SeriesPost %>%
filter(yearID > "1902", round == "WS") %>%
group_by(teamIDwinner) %>%
summarise(wincount = n()) %>%
arrange(desc(wincount))
ws_winner_table
#> # A tibble: 31 × 2
#> teamIDwinner wincount
#> <fct> <int>
#> 1 NYA 27
#> 2 SLN 11
#> 3 BOS 9
#> 4 LAN 8
#> 5 CIN 5
#> 6 NY1 5
#> 7 PHA 5
#> 8 PIT 5
#> 9 DET 4
#> 10 OAK 4
#> # ℹ 21 more rows
## Expanded form of World Series team data in modern era
ws <- SeriesPost %>%
filter(yearID >= 1903 & round == "WS") %>%
select(-ties, -round) %>%
mutate(lgIDloser = droplevels(lgIDloser),
lgIDwinner = droplevels(lgIDwinner))
# Bar chart of length of series (# games played)
# 1903, 1919 and 1921 had eight games
ggplot(ws, aes(x = wins + losses)) +
geom_bar(fill = "dodgerblue") +
labs(x = "Number of games", y = "Frequency")
# Last year the Cubs appeared in the WS
ws %>%
filter(teamIDwinner == "CHN" | teamIDloser == "CHN") %>%
summarise(max(yearID))
#> max(yearID)
#> 1 2016
# Dot chart of number of WS appearances by teamID
ws %>%
gather(wl, team, teamIDwinner, teamIDloser) %>%
count(team) %>%
arrange(desc(n)) %>%
ggplot(., aes(x = reorder(team, n), y = n)) +
theme_bw() +
geom_point(size = 3, color = "dodgerblue") +
geom_segment(aes(xend = reorder(team, n), yend = 0),
linetype = "dotted", color = "dodgerblue",
size = 1) +
labs(x = NULL, y = "Number of WS appearances") +
scale_y_continuous(expand = c(0, 0), limits = c(0, 42)) +
coord_flip() +
theme(axis.text.y = element_text(size = rel(0.8)),
axis.ticks.y = element_blank())
#> Warning: attributes are not identical across measure variables; they will be dropped
# Initial year of each round of championship series in modern era
SeriesPost %>%
filter(yearID >= 1903) %>% # modern WS started in 1903
group_by(round) %>%
summarise(first_year = min(yearID)) %>%
arrange(first_year)
#> # A tibble: 28 × 2
#> round first_year
#> <chr> <int>
#> 1 WS 1903
#> 2 NWS 1924
#> 3 NNC 1925
#> 4 NSC 1932
#> 5 NLC 1934
#> 6 ALC 1937
#> 7 NLP1 1939
#> 8 NLP2 1939
#> 9 ALCS 1969
#> 10 NLCS 1969
#> # ℹ 18 more rows
# Ditto, but with more information about each series played
SeriesPost %>%
filter(yearID >= 1903) %>%
group_by(round) %>%
arrange(yearID) %>%
do(head(., 1)) %>%
select(-lgIDwinner, -lgIDloser) %>%
arrange(yearID, round)
#> # A tibble: 28 × 7
#> # Groups: round [28]
#> yearID round teamIDwinner teamIDloser wins losses ties
#> <int> <chr> <fct> <fct> <int> <int> <int>
#> 1 1903 WS BOS PIT 5 3 0
#> 2 1924 NWS KCM HIL 5 4 1
#> 3 1925 NNC KCM SLS 4 3 0
#> 4 1932 NSC CAG NEG 4 3 0
#> 5 1934 NLC PS CAG 4 3 1
#> 6 1937 ALC KCM CAG 4 1 1
#> 7 1939 NLP1 BEG NE 3 1 0
#> 8 1939 NLP2 HG PS 3 2 0
#> 9 1969 ALCS BAL MIN 3 0 0
#> 10 1969 NLCS NYN ATL 3 0 0
#> # ℹ 18 more rows