This function standardizes MLB team abbreviations to Baseball Savant defaults. This helps for joins and plotting
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"
# }