Re: [R] add different regression lines for groups on ggplot

2013-07-29 Thread Ye Lin
CYAw&usg=AFQjCNH2b72a6un_xAM-PYxC-sUGU8-xOw&sig2=iBIrl1uhIsJXmPbAh4kUbw&bvm=bv.49784469,d.aWM > > You may be able to use two smooth statements to do what you want. > > John Kane > Kingston ON Canada > > > > -Original Message----- > > From: ye...@lbl.gov

Re: [R] add different regression lines for groups on ggplot

2013-07-27 Thread John Kane
3 12:21:23 -0700 > To: r-help@r-project.org > Subject: [R] add different regression lines for groups on ggplot > > Hey All, > > I need to apply different regression lines to different group on my > ggplot, > and here is the code I use: > > qplot(x=Var1,y=Var2,data=df

[R] add different regression lines for groups on ggplot

2013-07-26 Thread Ye Lin
Hey All, I need to apply different regression lines to different group on my ggplot, and here is the code I use: qplot(x=Var1,y=Var2,data=df,color=SiteID,group=SiteID)+geom_point()+geom_smooth(method='lm',formula=log(y)~I(1/x),se=FALSE,size=2) However the regression for different groups is as be