powered by
These functions mix colour vectors with math functions.
# S3 method for palettes_colour sum(..., na.rm = FALSE)# S3 method for palettes_colour cumsum(x)
# S3 method for palettes_colour cumsum(x)
These functions return colour vectors of class palettes_colour:
palettes_colour
sum() returns the sum of all the colours present in its arguments with additive colour mixing.
sum()
cumsum() returns a vector whose elements are the cumulative sums of the elements of the argument with additive colour mixing.
cumsum()
Colour vectors of class palettes_colour.
Whether to include missing values. Either TRUE or FALSE.
TRUE
FALSE
An object of class palettes_colour.
x <- pal_colour(c("red", "blue")) sum(x) x <- pal_colour(c("red", "blue", "yellow")) cumsum(x)
Run the code above in your browser using DataLab