ggplotColors | R Documentation |
This function takes as input the number of colours the user would like, and outputs a vector of colours in the ggplot colour scheme.
ggplotColors(g)
g |
the number of colours to be generated. |
a vector with the names of the colours.
Belinda Phipson
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.