ggplotColors: Output a vector of colours based on the ggplot colour scheme

View source: R/ggplotColors.R

ggplotColorsR Documentation

Output a vector of colours based on the ggplot colour scheme

Description

This function takes as input the number of colours the user would like, and outputs a vector of colours in the ggplot colour scheme.

Usage

ggplotColors(g)

Arguments

g

the number of colours to be generated.

Value

a vector with the names of the colours.

Author(s)

Belinda Phipson

Examples

# Generate a palette of 6 colours
cols <- ggplotColors(6)
cols

# Generate some count data
y <- matrix(rnbinom(600, mu=100, size=1), ncol=6)

par(mfrow=c(1,1))
boxplot(y, col=cols)


Oshlack/speckle documentation built on Oct. 16, 2022, 9:39 a.m.