Skip to contents

This function standardizes MLB team abbreviations to Baseball Savant defaults. This helps for joins and plotting

Usage

clean_team_abbrs(abbr, keep_non_matches = TRUE)

Arguments

abbr

a character vector of abbreviations

keep_non_matches

will non-matches be kept in the vector?

Value

A character vector with the length of abbr and cleaned team abbreviations if they are included in team_data. Non matches may be replaced with NA (depending on the value of keep_non_matches).

Examples

# \donttest{
x <- c("PIE", "STL", "WSN", "CWS", "CHW")
# use current location and keep non matches
clean_team_abbrs(x)
#> [1] "PIE" "STL" "WSH" "CWS" "CWS"
# }