# Select three first green colours
EcdcColors("green", n=3)
# Select two first qualitative colours
EcdcColors("qual", n=2)
# Select seven red colours
EcdcColors("red", n=7)
EcdcColors("grey", grey_shade = c("mediumlight", "dark"))
# Use in a graph
# Dummy data
mydat <- data.frame(ID = c(seq(1,10,1)),
Gender = c(rep(c("F", "M"),5)))
barplot(table(mydat$Gender),
col = EcdcColors(col_scale = "qual", n=2))
# Hot-cold colour scale
barplot(c(1:4),
col = EcdcColors(col_scale = "hotcold", n = 4, hot_cols = 2))
Run the code above in your browser using DataLab