On Thu, Jul 30, 2009 at 3:09 PM, jimdare<jamesdar...@gmail.com> wrote: > > Dear R Users, > > I have a dataset that I have split by group. For each group I plot a figure > using: > > for (i in splitdf){ > plot<-xyplot(................) > print(plot) > savePlot(filename=paste(i$Group[1]),type="pdf") > } > > This gives me X pdf files where X is the number of groups. > Does anyone know a simple way to get the name of the plot [plot<-xyplot()] > to differ for each rin of the loop so I can merge them into a single pdf > files using. > > pdf(filename="mergedplots") > plot1 > .... > plotX > dev.off()
Whats wrong with pdf(file="foo.pdf") for (i in splitdf) { plot<-xyplot(................) print(plot) } dev.off() ? -Deepayan ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.