powered by
color.factor(color, value, max)
data <- 1:10 cols=color.factor("red", data, max=10) plot(data, col=cols) cols=color.factor(c("red","green","blue"), data, max=10) plot(data, col=cols)
Run the code above in your browser using DataLab