clean_team_abbrs: Standardize MLB Team Abbreviations

View source: R/load_data.R

clean_team_abbrsR Documentation

Standardize MLB Team Abbreviations

Description

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


x <- c("PIE", "STL", "WSN", "CWS", "CHW")
# use current location and keep non matches
clean_team_abbrs(x)


camdenk/mlbplotR documentation built on Nov. 18, 2024, 10:29 p.m.