I'm having some problems with colour palettes in ggplot2
. When I try the following code, an error is produced.
library(ggplot2)
> ggplot(Vocab, x = education, y = vocabulary, col = year, group = factor(year)) +
+ stat_quantile(method = "lm", se = F, alpha = 0.6, size = 2) +
+ scale_color_brewer(colors = brewer.pal(9, "Y10rRd"))
Warning: Ignoring unknown parameters: se
Error in brewer.pal(9, "Y10rRd") :
Y10rRd is not a valid palette name for brewer.pal
"Y10rRd" colour palette is removed nowadays or do I need any prerequisite settings to get it valid for this code? Help me to make it work.
I suspect you made a typo "YIOrRd." In any case, here you may find all pal names: https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/colorPaletteCheatsheet.pdf