| mlb.colors | R Documentation |
Returns a named character vector of hex colors for an MLB team. Teams cover
the 2026 Major League Baseball season.
Call colorr.teams("mlb") for the full list of team names.
mlb.colors(
set = c("angels", "astros", "athletics", "blue_jays", "braves", "brewers", "cardinals",
"cubs", "diamondbacks", "dodgers", "giants", "guardians", "indians", "mariners",
"marlins", "mets", "nationals", "orioles", "padres", "phillies", "pirates",
"rangers", "rays", "red_sox", "reds", "rockies", "royals", "tigers", "twins",
"white_sox", "yankees"),
legacy = FALSE
)
set |
Character string naming an MLB team.
The retired team name |
legacy |
Logical. If |
Named character vector of hex color strings.
Charles Crabtree charles.crabtree@monash.edu
colorr.teams to list teams, scale_fill_mlb for the
ggplot2 scales.
# Colorado Rockies colors
pal <- mlb.colors("rockies")
pal
pie(rep(1, length(pal)), labels = sprintf("%d (%s)", seq_along(pal), pal), col = pal)
# Seattle Mariners colors
mlb.colors("mariners")
# the palette that shipped with colorr 1.0.1
mlb.colors("rockies", legacy = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.