groups = sample(LETTERS[1:5], size=100, replace=TRUE)
plot(rnorm(100), rnorm(100), col=string.to.colors(groups))
plot(rnorm(100), rnorm(100), col=string.to.colors(groups),
pch=as.numeric(string.to.colors(groups, colors=c(16:20))))
Run the code above in your browser using DataLab