TeamFranchises table
TeamsFranchises.Rd
Information about team franchises
Usage
data(TeamsFranchises)
Format
A data frame with 120 observations on the following 4 variables.
franchID
Franchise ID; a factor
franchName
Franchise name
active
Whether team is currently active (Y or N)
NAassoc
ID of National Association team franchise played as
Source
Lahman, S. (2024) Lahman's Baseball Database, 1871-2023, 2024 version, http://www.seanlahman.com/
Examples
data(TeamsFranchises)
# Which of the active Major League Baseball teams had a National Association predecessor?
# Notes:
# - the National Association was founded in 1871, and continued through the
# 1875 season. In 1876, six clubs from the National Association and two other
# independent clubs formed the National League, which exists to this day.
# - the `active` field has "NA" for the National Association franchises
# - where appropriate, the `NAassoc` field has the `franchID` of the successor National League team
# using the dplyr data manipulation package
library("dplyr")
NatAssoc_active_table <- TeamsFranchises %>%
filter(active == "Y") %>%
filter(!is.na(NAassoc))
NatAssoc_active_table
#> franchID franchName active NAassoc
#> 1 ATL Atlanta Braves Y BNA
#> 2 CHC Chicago Cubs Y CNA
# Merge current team IDs with franchise IDs
currentTeams <- Teams %>%
filter(yearID == 2014) %>%
select(teamID, franchID, lgID, park)
# Merge TeamsFranchises with currentTeams
TeamsFranchises %>%
filter(active == "Y") %>%
select(-active, -NAassoc) %>%
left_join(currentTeams, by = "franchID")
#> franchID franchName teamID lgID
#> 1 ANA Los Angeles Angels of Anaheim LAA AL
#> 2 ARI Arizona Diamondbacks ARI NL
#> 3 ATL Atlanta Braves ATL NL
#> 4 BAL Baltimore Orioles BAL AL
#> 5 BOS Boston Red Sox BOS AL
#> 6 CHC Chicago Cubs CHN NL
#> 7 CHW Chicago White Sox CHA AL
#> 8 CIN Cincinnati Reds CIN NL
#> 9 CLE Cleveland Indians CLE AL
#> 10 COL Colorado Rockies COL NL
#> 11 DET Detroit Tigers DET AL
#> 12 FLA Florida Marlins MIA NL
#> 13 HOU Houston Astros HOU AL
#> 14 KCR Kansas City Royals KCA AL
#> 15 LAD Los Angeles Dodgers LAN NL
#> 16 MIL Milwaukee Brewers MIL NL
#> 17 MIN Minnesota Twins MIN AL
#> 18 NYM New York Mets NYN NL
#> 19 NYY New York Yankees NYA AL
#> 20 OAK Oakland Athletics OAK AL
#> 21 PHI Philadelphia Phillies PHI NL
#> 22 PIT Pittsburgh Pirates PIT NL
#> 23 SDP San Diego Padres SDN NL
#> 24 SEA Seattle Mariners SEA AL
#> 25 SFG San Francisco Giants SFN NL
#> 26 STL St. Louis Cardinals SLN NL
#> 27 TBD Tampa Bay Rays TBA AL
#> 28 TEX Texas Rangers TEX AL
#> 29 TOR Toronto Blue Jays TOR AL
#> 30 WSN Washington Nationals WAS NL
#> park
#> 1 Angel Stadium of Anaheim
#> 2 Chase Field
#> 3 Turner Field
#> 4 Oriole Park at Camden Yards
#> 5 Fenway Park II
#> 6 Wrigley Field
#> 7 U.S. Cellular Field
#> 8 Great American Ball Park
#> 9 Progressive Field
#> 10 Coors Field
#> 11 Comerica Park
#> 12 Marlins Park
#> 13 Minute Maid Park
#> 14 Kauffman Stadium
#> 15 Dodger Stadium
#> 16 Miller Park
#> 17 Target Field
#> 18 Citi Field
#> 19 Yankee Stadium III
#> 20 O.co Coliseum
#> 21 Citizens Bank Park
#> 22 PNC Park
#> 23 Petco Park
#> 24 Safeco Field
#> 25 AT&T Park
#> 26 Busch Stadium III
#> 27 Tropicana Field
#> 28 Globe Life Park in Arlington
#> 29 Rogers Centre
#> 30 Nationals Park