Description Usage Arguments Details Value See Also Examples
This function takes a factor vector and returns suitable colours
representing the factor levels. Default is to try to use
RColorBrewer
for colours, and rainbow
otherwise. Can
provide custom colours.
1 | factor2color(x, colors = NULL)
|
x |
A factor vector. |
colors |
The colours to use. Defaults to a qualitative colour scheme;
either |
Uses the RColorBrewer
package if installed. Coerces x
to factor with a warning.
A character vector of colours.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.