paleta_old | R Documentation |
This function generates color palettes of various types, including sequential, categorical, or divergent, with a specified number of levels.
paleta_old(
name,
n = NULL,
type = NULL,
alpha = NULL,
reverse = FALSE,
recycle = TRUE
)
name |
Character string or vector, specifying the name of the palette or directly providing the colors. |
n |
Integer, number of colors to generate. If NULL, the default length of the palette is used. |
type |
Character string, type of the palette ("sequential", "categorical", or "diverging"). If NULL, inferred from the name or defaults to "categorical". |
alpha |
Numeric, value of alpha transparency (between 0 and 1). If NULL, no transparency is added. |
reverse |
Logical, if TRUE, reverses the order of the colors. |
recycle |
Logical, if TRUE and the palette is categorical, allows recycling of colors when n exceeds the number of available colors. |
A character vector of color values.
paleta("viridis", n = 5)
paleta(c("red", "green", "blue"), n = 3, type = "categorical")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.