View source: R/discrete_palette.R
discrete.palette | R Documentation |
This function aims to give a 'discrete' palette, that is, a palette without gradient and with some user-defined repeated colors.
discrete.palette (ncols, cols, freqs, steps)
ncols |
The number of colors to be outputted. Must be equal or superior to the length of |
cols |
The colors to be used. |
freqs |
Optional. The proportions for the repartition of the colors. By default, proportions are all equal. |
steps |
Optional. The value of the steps the colors represent. |
The function takes as input the colors the user wants to repeat, and optionally their proportions if it is not intended to distribute them equally. The equal distribution may not be fully true: if needed, proportional samples are rounded to have an integer number of repeats of each color. The goal is rather to output the specified number of colors the user wants.
A vector that contains ncols
color codes, with all cols
repeated.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.