I'm making a scatterplot of 2 continuous variables and a 4-level factor in R, using ggplot2. The 4-level factor column has some NAs in it.
p1 <- qplot(x_var, y_var, color=4_factor, data=df)
p1
...which works fine, colouring the NAs as grey and the factors using the default qualitative palette. But, my factors are ordered so I would prefer to use one of the diverging colour palettes from Color Brewer.
p2 <- p1 + scale_colour_brewer(palette="RdYlGn")
p2
Now, the NAs don't display as grey any more. How do I add an NA colour into the colour brewer palette please?