Learn R Programming

Laurae (version 0.0.0.9001)

brewer.pal_extended: RColorBrewer's Extended Palettes without Warning

Description

Creates nice looking color palettes especially for thematic maps. This modification ColorBrewer palette extends to an infinite amount of colors. You may choose a palette inside: between c("None", "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").

Usage

brewer.pal_extended(n, name)

Arguments

n
Type: numeric. The number of colors you want back.
name
Type: character. The palette name you can find via brewer.pal.info when RColorBrewer is loaded in memory.

Value

A color palette in a numeric vector following the hexadecimal RGB format (#RRGGBB) ready to be used.

Examples

Run this code
library(RColorBrewer)
brewer.pal_extended(20, "BrBG") # Generate a palette of 20 colors when it cannot

Run the code above in your browser using DataLab