Description Usage Arguments Details Value
View source: R/vec_pal_colours.R
Create colour scale and indexes for vector
1 | vec_pal_colours(vec, palette_fn, n_cols, zero_index = FALSE)
|
vec |
a numeric of vector of values to generate palette indexes for |
palette_fn |
a function that will produce a vector of integer colour code strings, when called: 'palette_fn(n_cols)' |
n_cols |
the number of colours to generate using the 'palette_fn'. |
zero_index |
should the colour indexes begin at 0, for use with 0 indexed languages like Javascript? |
Given a vector of numeric values, return a palette of size 'n_cols“ and a set of indexes into the palette of size equal to the numeric vector.
A list contain two named vectors: 'colours' and 'indexes'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.