Re: [R] plot residuals per factor

2013-01-09 Thread arun
ls=c("C","D","E","A","B"))  levels(dat1$d1) #[1] "C" "D" "E" "A" "B" mypath<-file.path("/home/arun/Trial1",paste("catalin_",LETTERS[c(3,4,5,1,2)],".jpg",sep=&quo

Re: [R] plot residuals per factor

2013-01-08 Thread arun
riginal Message - From: catalin roibu To: r-help@r-project.org Cc: Sent: Tuesday, January 8, 2013 4:22 AM Subject: [R] plot residuals per factor Dear R-users, I want to plot residuals vs fitted for multiple groups with ggplot2. I try this code, but unsuccessful. library("plyr&quo

[R] plot residuals per factor

2013-01-08 Thread catalin roibu
Dear R-users, I want to plot residuals vs fitted for multiple groups with ggplot2. I try this code, but unsuccessful. library("plyr") models<-dlply(dat1,"d",function(df) mod<-lm(y~x,data=df) ggplot(models,aes(.fitted,.resid), color=factor(d))+ geom_hline(yintercept=0,col="white",size=2)+ geo