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

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -