I'm new in GGally and I'd like to ask u how to add colours in the different lines of my variables in ggpairs(). Can I give a specific colour for each one?
Thanks!
I'm new in GGally and I'd like to ask u how to add colours in the different lines of my variables in ggpairs(). Can I give a specific colour for each one?
Thanks!
If you just want to add/specify color for groups, you can set these manually using scale_fill_manual or scale_color_manual depending on the type of plot in the upper/lower/diagonal regions of the plot:
library(GGally)
pm <- ggpairs(flea, columns = 2:4, ggplot2::aes(colour=species))
pm +
scale_color_manual(values = c("red", "blue", "purple")) +
scale_fill_manual(values = c("red", "blue", "purple"))