Learn R Programming

colorr (version 1.0.0)

mlb.colors: MLB colors

Description

Function returns a vector of character strings from a selected MLB team's color palette. The team options are c("diamondbacks", "braves", "orioles", "red_sox", "cubs", "white_sox", "reds", "indians", "rockies", "tigers", "astros", "royals", "angels", "dodgers", "marlins", "brewers", "twins", "mets", "yankees", "athletics", "phillies", "pirates", "padres", "giants", "mariners", "cardinals", "rays", "rangers", "blue_jays", "nationals").

Usage

mlb.colors(set = c("diamondbacks", "braves", "orioles", "red_sox", "cubs",
  "white_sox", "reds", "indians", "rockies", "tigers", "astros", "royals",
  "angels", "dodgers", "marlins", "brewers", "twins", "mets", "yankees",
  "athletics", "phillies", "pirates", "padres", "giants", "mariners",
  "cardinals", "rays", "rangers", "blue_jays", "nationals"))

Value

Vector of character strings from the selected MLB team's color palette.

Arguments

set

Character string denoting an MLB team's color palette.

Author

Charles Crabtree [email protected]

Examples

Run this code
if (FALSE) {
# Colorado Rockies colors
(pal = mlb.colors("rockies"))
pie(rep(1, length(pal)), labels = sprintf("%d (%s)", seq_along(pal), pal), col = pal)

# Seattle Mariners colors
(pal = mlb.colors("mariners"))
pie(rep(1, length(pal)), labels = sprintf("%d (%s)", seq_along(pal), pal), col = pal)
}

Run the code above in your browser using DataLab