search for: plot_number_

Displaying 1 result from an estimated 1 matches for "plot_number_".

2011 Aug 10
1
Sequential Naming of ggplot .pngs using plyr
If I have data: dat<-data.frame(a=rnorm(20),b=rnorm(20),c=rnorm(20),d=rnorm(20),site=rep(letters[5:8],each=5)) And want to plot like this: ctr<-1 for(i in c('a','b','c','d')){ png(file=paste('/tmp/plot_number_',ctr,'.png',sep=''),height=8.5, width=11,units='in',pointsize=9,res=300) print(ggplot(dat[,names(dat) %in% c('site',i)],aes(x=factor(site),y=dat[,i]))+geom_boxplot()+opts(title=paste('plot number',ctr,sep=' '))) dev.off() ctr<-ctr+1...