Re: [R] color by group in ggplot

2013-05-03 Thread David Winsemius
On May 3, 2013, at 1:57 PM, Ye Lin wrote: > I want to plot the values of "Var1" and "Var2" on the same plot, with x-axis > labeling as the list of IDs. Sth like this: > > > But I want to color the points based on the category in "Group", I dont know > how to do it with ggplot. You didn't sa

Re: [R] color by group in ggplot

2013-05-03 Thread Ye Lin
Thanks A.K I also add "shape=variable" so that it is much easier to tell two variables by color +shape On Fri, May 3, 2013 at 2:14 PM, arun wrote: > HI, > May be this helps: > > dat1<- read.table(text=" > IDVar1 Var2Group > A111BB > A21

Re: [R] color by group in ggplot

2013-05-03 Thread arun
HI, May be this helps: dat1<- read.table(text=" ID    Var1  Var2    Group A1    1    1    BB A2    1  2    AA B1  2  1    CC B2    1    3    DD C1  1    2    EE ",sep="",header=TRUE) lib

Re: [R] color by group in ggplot

2013-05-03 Thread Ye Lin
I want to plot the values of "Var1" and "Var2" on the same plot, with x-axis labeling as the list of IDs. But I want to color the points by their category in "Group". Is it possible to do in ggplot, or do i have to plot from scratch using basic plot? On Fri, May 3, 2013 at 1:49 PM, David Winsemi

Re: [R] color by group in ggplot

2013-05-03 Thread David Winsemius
On May 3, 2013, at 1:37 PM, Ye Lin wrote: > Hey, > > I have a dataset like this: > > ID Var1 Var2 Group > A1 11BB > A2 1 2AA > B1 2 1 CC > B2 13DD > C1