I am trying to define the colours of groups of points plotted in ggplot. I adapted code from this post:
Color ggplot points based on defined color codes
but
It works if you use unique and as.character:
unique
as.character
ggplot(data = df, aes(col, D, colour = zone))+ geom_point() + scale_colour_manual(breaks = df$zone, values = unique(as.character(df$color.codes)))