af_colours {afcolours} | R Documentation |
Analysis Function colour palette function
Description
Generate a colour palette based on the selected chart and colour_format type (hex/rgb).
Usage
af_colours(
type = c("categorical", "duo", "sequential", "focus"),
colour_format = "hex",
n = 6
)
Arguments
type |
Name of required palette. Choices are:
|
colour_format |
Type of colour code to return. Choices are:
|
n |
Number of colours to return for categorical palette type (max 6). If omitted, uses all colours. |
Value
A vector of colour codes
Examples
data <- data.frame(x = c(1,2),
y = c(1,2),
z = c("a","b")
)
ggplot2::ggplot(data, ggplot2::aes(x = x, y = y, colour = z)) +
ggplot2::geom_point() +
ggplot2::scale_colour_manual(values = af_colours("duo"))
[Package afcolours version 1.0.0 Index]