[R] pdf files in loops

Berwin A Turlach berwin at maths.uwa.edu.au
Thu Apr 1 04:14:16 CEST 2010


On Wed, 31 Mar 2010 22:06:48 -0400
James Rome <jamesrome at gmail.com> wrote:

> print() did not help, and I get strange messages about mode(onefile)
> not being changed:

Either:

R> pic <- histogram(...)
R> print(pic)

or

R> print(histogram(...))

> I would actually like all the histograms in one pdf file too...

Then move the pdf() and the dev.off() commands outside the loop.

HTH.

Cheers,

	Berwin



More information about the R-help mailing list