[R] Using postscript() in a script that is source()ed

Thomas Lumley tlumley at u.washington.edu
Thu Jun 3 00:50:10 CEST 2004


On Wed, 2 Jun 2004, Anthony Darrouzet-Nardi wrote:

> I have a script that draws 9 graphics which I would like to run by
> source()ing the file. In the script I make objects that contain each
> of the graphics (all lattice objects or functions that contain
> lattice functions). Then at the end of the script, I have a section
> which prints them to separate eps files like this:

There isn't any print() command here, so the object isn't printed.


> postscript(file = "dryoutcover.eps", height = 5, width = 7,
> 	horizontal = FALSE, onefile = FALSE, paper = "special")
> dryoutcover.plot # this is an object created by xyplot and it's one
> of the ones that doesn't print.
> dev.off()
>
> When I run the script using source(), only a couple of the graphics
> are drawn in the eps files. For the rest of them, there are blank eps
> files.
>

<SNIP>
> How can I get the non-verbose source() of my script to work?

Use print().

	-thomas

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle




More information about the R-help mailing list