r - How to colour every sub group of points? -
i trying plot set of points in r "plot" command, sub group them colour. e.x. have 9 points first 3 points in red, next 3 points blue , ...
you have provide vector of respective colors
plot(1:9, 1:9, col = c(rep("black", 3), rep("blue", 3), rep("red", 3))) altough under normal circumstances shouldn't manually, creating vector of colours according grouping variable instead.
Comments
Post a Comment