Re: [R] Color With a Function

2013-12-19 Thread Jim Lemon
On 12/20/2013 10:38 AM, bradford wrote: I use ggplot2 a lot and am wondering why I can't just color with a function? For example, if value< 0 then use red else use green. How would you guys suggest to color these bar graphs so that positive is green and negative is red? ggplot(melt(df,measure

Re: [R] Color With a Function

2013-12-19 Thread Jeff Newmiller
Design questions ("why...") should go to the package maintainer. You need to learn to ask complete questions [1] and post in plain text rather than HTML on this list. I think that normal practice is to add a factor column that reflects the coloring you want, and then reference it. E.g.: lib

[R] Color With a Function

2013-12-19 Thread bradford
I use ggplot2 a lot and am wondering why I can't just color with a function? For example, if value < 0 then use red else use green. How would you guys suggest to color these bar graphs so that positive is green and negative is red? ggplot(melt(df,measure.vars=c("data1", "data2", "data3", "data4"