[R] Color barplots with a conditional?

Allie818 alice.ly at gmail.com
Wed Sep 14 22:14:20 CEST 2011


I've made a barplot that has several bars. I'd like the bars to be colored
according to the type of category they are in. Is there a way to put a
conditional into the color parameter in barplot?
i.e. if data$category[i] == 1, color the bar red

Do I need to generate the coloring sequence before the plot code first?

Thanks!!


--
View this message in context: http://r.789695.n4.nabble.com/Color-barplots-with-a-conditional-tp3813990p3813990.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list