[R] qplot and colors (Please Help)

David Lyon david_lyon3 at yahoo.com
Wed Jun 27 18:07:53 CEST 2012



Please help:


I am using qplot as below and want to specify a different color scheme for race but dont know how, can someone show me.


Thanks in advance



Code and input file below:



library(ggplot2)
library(gridExtra)
d<-read.table("results", header=TRUE, fill=TRUE)
plot2<-qplot(X,Y,data=d,color=race,facets=TYPE~., xlab="X", ylab="Y") + theme_bw() 
grid.arrange(plot2,ncol=1)
dev.off()


cat  results
<snip>
X       Y       ID      race    TYPE
0.0350  0.0200    1    X    NA
0.0280  0.0251    2    X    NA
0.0258  0.0175    3    Y    NA
</snip>



More information about the R-help mailing list