TeamsHalf.RdSplit season data for teams
data(TeamsHalf)A data frame with 52 observations on the following 10 variables.
yearIDYear
lgIDLeague; a factor with levels AL NL
teamIDTeam; a factor
HalfFirst or second half of season
divIDDivision
DivWinWon Division (Y or N)
RankTeam's position in standings for the half
GGames played
WWins
LLosses
Lahman, S. (2024) Lahman's Baseball Database, 1871-2024, 2025 version, https://sabr.org/lahman-database/
# 1981 season team data split into half seasons
data(TeamsHalf)
library("dplyr")
# List standings with winning percentages by
# season half, league and division
TeamsHalf %>%
group_by(Half, lgID, divID) %>%
mutate(WinPct = round(W/G, 3)) %>%
arrange(Half, lgID, divID, Rank) %>%
select(Half, lgID, divID, Rank, teamID, WinPct)
#> # A tibble: 52 × 6
#> # Groups: Half, lgID, divID [8]
#> Half lgID divID Rank teamID WinPct
#> <int> <fct> <chr> <int> <fct> <dbl>
#> 1 1 AL E 1 NYA 0.607
#> 2 1 AL E 2 BAL 0.574
#> 3 1 AL E 3 ML4 0.554
#> 4 1 AL E 4 DET 0.544
#> 5 1 AL E 5 BOS 0.536
#> 6 1 AL E 6 CLE 0.52
#> 7 1 AL E 7 TOR 0.276
#> 8 1 AL W 1 OAK 0.617
#> 9 1 AL W 2 TEX 0.6
#> 10 1 AL W 3 CHA 0.585
#> # ℹ 42 more rows