I created a scatterplot using data that does not group the variables, so I want to color the points based on column name instead. How can I do that? There is plenty of info online showing how to color the points if you can sort them by group, as shown below.
data(iris)
my_cols <- c("#00AFBB", "#E7B800", "#FC4E07")
pairs(iris[,1:4], pch = 19, cex = 0.5,
col = my_cols[iris$Species],
lower.panel=NULL)
Using this dataset, imagine you cannot change the color based on species. How would you change the color for each variable?