mlb_pal: MLB Team colors

Description Usage Arguments See Also Examples

View source: R/colors.R

Description

MLB Team colors

Usage

1
2
3
4
5
mlb_pal(which = 1, names = "teamID")

scale_fill_mlb(which = 1, names = "teamID", ...)

scale_color_mlb(which = 1, names = "teamID", ...)

Arguments

which

Integer giving the set of colors you want. Default is 1 for "primary".

names

The quoted name of the column of the tibble returned by lkup_teams that you want to use as the names of the colors. This will need to match the data in the variable you want to map to color.

...

Arguments passed on to ggplot2::scale_fill_manual

values

a set of aesthetic values to map data values to. If this is a named vector, then the values will be matched based on the names. If unnamed, values will be matched in order (usually alphabetical) with the limits of the scale. Any data values that don't match will be given na.value.

aesthetics

Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the colour and fill aesthetics at the same time, via aesthetics = c("colour", "fill").

See Also

team_pal, scale_fill_teams, scale_color_teams

Examples

1
2
3
4
5
mlb_pal() != mlb_pal(2)

mlb_pal(names = "lahman_name")
mlb_pal(names = "teamcolors_name")
mlb_pal(2, names = "city")

beanumber/mlbgm documentation built on Jan. 21, 2020, 8:33 p.m.