Description Usage Arguments Details Value
Create a named color palette for a factor
1 | factor_palette(x, colors, ...)
|
x |
A factor or character vector to use for the levels |
colors |
A vector of colors |
... |
Here, the user can provide numeric index values for colors that should be used first, second, third, and so on in the palette. This allows for the colors to be rearranged if they are not quite cutting it in the default order. |
This function may be most useful in conjunction with dput()
,
which will print out the code for the resultant palette. This way, color
palettes can be hard-coded into scripts, which will preserve the color
scheme even if the levels of the factor were to change in the future.
A named vector of colors corresponding to the factor.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.