getAetnaPal: Hex color vector in a palette

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Get a vector of hex colors from a designated palette.

Usage

1
getAetnaPal(palname, n = Inf, show = FALSE, output_func = FALSE, ...)

Arguments

palname

Palette name.

n

Length of color vector.

show

Logical, whether display the palette. Default FALSE.

output_func

Logical, whether output the function to generate colors. Default FALSE, which indicates that the color vector instead of the function is returned.

...

Other arguments to pass to the function. E.g., theme='Atlas' can be passed to excel_newe_pal() when palname='excel_new'; or direction = -1 can be passed to tableau_color_pal when palname='tableau10'

Details

getAetnaPal generally gets hex value of the colors in a designated palette. The palettes include Aetna palette, palette in packages RColorBrewer, ggthemes and viridis. The following palettes are usable:

Aetna palttes

'aetnagreen', 'aetnablue', 'aetnaviolet', 'aetnaorange', 'aetnateal', 'aetnacranberry'

RColorBrewer palettes

'BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral', 'Accent', 'Dark2', 'Paired', 'Pastel1', 'Pastel2', 'Set1', 'Set2', 'Set3', 'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd'

ggthemes palettes
  • normal: 'calc', 'economist', 'economist_white', 'excel_line', 'excel_fill', 'excel_new', 'few', 'fivethirtyeight', 'gdocs', 'pander', 'stata', 'stata1', 'stata1r','statamono','hc', 'darkunica','wsj', 'wsj_rgby', 'wsj_red_green', 'wsj_black_green', 'wsj_dem_rep',

  • tableau (see tableau_color_pal):

    'regular' / 'qual'

    "tableau10", "tableau20", "tbl_colorblind", "tbl_seattle_grays", "tbl_traffic", "tbl_miller_stone", "tbl_superfishel_stone", "tbl_nuriel_stone", "tbl_jewel_bright", "tbl_summer", "tbl_winter", "tbl_gnorte", "tbl_rdbubw", "tbl_pupkgy", "tbl_hue_circle", "tbl_classic10", "tbl_classic10_medium", "tbl_classic10_light", "tbl_classic20", "tbl_classic_gray5", "tbl_classic_colorblind", "tbl_classic_traffic_light", "tbl_classic_pugy6", "tbl_classic_pugy12", "tbl_classic_gnor6", "tbl_classic_gnor12", "tbl_classic_burd6", "tbl_classic_burd12", "tbl_classic_cyclic"

    'ordered-diverging' / 'div'

    "tbl_orbu_div", "tbl_rdgn_div", "tbl_gnbu_div", "tbl_rdbu_div", "tbl_rdbl_div", "tbl_gdpu_div", "tbl_rdgngd_div", "tbl_sunset_sunrise_div", "tbl_orbuwi_div", "tbl_rdgnwi_div", "tbl_gnbuwi_div", "tbl_rdbuwi_div", "tbl_rdblwi_div", "tbl_orbu_light_div", "tbl_temperature_div", "tbl_classic_rdgn", "tbl_classic_rdbu", "tbl_classic_rdbl", "tbl_classic_area_rdgn", "tbl_classic_orbu", "tbl_classic_gnbu", "tbl_classic_rdwign", "tbl_classic_rdwibl", "tbl_classic_orwibu", "tbl_classic_rdwibl_light", "tbl_classic_orwibu_light", "tbl_classic_rdwign_light", "tbl_classic_rdgn_light"

    'ordered-sequential' / 'seq'

    "tbl_bugn_seq", "tbl_blue_light", "tbl_orange_light", "tbl_blue", "tbl_orange", tbl_green", "tbl_red", "tbl_purple", "tbl_brown", "tbl_gray", "tbl_gray_warm", "tbl_bute", "tbl_orgd", "tbl_gngd", "tbl_rdgd", "tbl_classic_green", "tbl_classic_gray", "tbl_classic_blue", "tbl_classic_red", "tbl_classic_orange", "tbl_classic_area_red", "tbl_classic_area_green", "tbl_classic_area_brown"

  • solarized: 'solarized','solarized_red', 'solarized_yellow', 'solarized_orange','solarized_magenta','solarized_violet', 'solarized_blue', 'solarized_cyan', 'solarized_green', 'colorblind', 'trafficlight'

viridis palettes

'megma', 'inferno', 'plasma', 'viridis', 'cividis'

grDevices palettes

'rainbow', 'terrain', 'topo', 'heat', 'cm'

Value

A vector of Hex colors (output_func=FALSE) or the color generation function (output_func=TRUE).

Author(s)

Yiying Wang, wangy@aetna.com

See Also

RColorBrewer ggthemes

Examples

1
2
3
4
5
6
7
8
## Not run: 
## Get the entire Aetna green palette
getAetnaPal("aetnagreen")

## Get 7 colors from palette 'terrain'
getAetnaPal("terrain", 7)

## End(Not run)

madlogos/aseshms documentation built on May 21, 2019, 11:03 a.m.