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
quot;ID","Group")) > library(ggplot2) > ggplot(dat2,aes(x=ID,y=value,group=Group,colour=Group))+geom_point() > A.K. > > > > - Original Message - > From: Ye Lin > To: R help > Cc: > Sent: Friday, May 3, 2013 4:37 PM > Subject: [R]

Re: [R] color by group in ggplot

2013-05-03 Thread arun
quot;",header=TRUE) library(reshape2) dat2<-melt(dat1,id.var=c("ID","Group")) library(ggplot2) ggplot(dat2,aes(x=ID,y=value,group=Group,colour=Group))+geom_point() A.K. - Original Message - From: Ye Lin To: R help Cc: Sent: Friday, May 3, 2013 4:37 PM Subject

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

[R] color by group in ggplot

2013-05-03 Thread Ye Lin
Hey, I have a dataset like this: ID Var1 Var2 Group A1 11BB A2 1 2AA B1 2 1 CC B2 13DD C1 12EE I would like to plot the point