| palette_color_picker | R Documentation | 
Maps values to colors.
palette_color_picker(
  scheme,
  domain = NULL,
  midpoint = NULL,
  ordered = FALSE,
  missing = NULL,
  ...
)
palette_colour_picker(
  scheme,
  domain = NULL,
  midpoint = NULL,
  ordered = FALSE,
  missing = NULL,
  ...
)
scheme | 
 A   | 
domain | 
 A   | 
midpoint | 
 A length-one   | 
ordered | 
 A   | 
missing | 
 The color to return for   | 
... | 
 Further parameters to be passed to   | 
A wrapper around palette_color_continuous() and
palette_color_discrete().
A palette function that when called with a single argument returns
a character vector of colors.
Other palettes: 
palette_color_continuous(),
palette_color_discrete(),
palette_shape(),
palette_size
## Visualize a simple DEM model
## Distribution of elevation values
elevation <- hist(volcano)
## Where are breaks?
elevation$breaks
## Build palette functions
ramp_BuRd <- palette_color_picker("BuRd")
(col <- ramp_BuRd(elevation$breaks))
image(volcano, col = col)
legend("topright", legend = elevation$breaks, fill = col)
## Rescale to midpoint
ramp_BuRd <- palette_color_picker("BuRd", midpoint = 160)
(col <- ramp_BuRd(elevation$breaks))
image(volcano, col = col)
legend("topright", legend = elevation$breaks, fill = col)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.