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:

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.

The script works properly (the 9 eps files all have graphics in them) when I cut and paste the contents of it into R. It also works properly if I use source(..., verbose = T) giving output such as:


eval(expression_nr. 82 )
                 =================

postscript(file = "dryoutcover.eps", height = 5, width = 7,
horizontal = FALSE, onefile = FALSE, paper = "special")
curr.fun: symbol postscript
.. after 'expression(postscript(file = "dryoutcover.eps", height = 5, width = 7, '' horizontal = FALSE, onefile = FALSE, paper = "special"))'


eval(expression_nr. 83 )
                 =================

dryoutcover.plot
 .. after 'expression(dryoutcover.plot)'

eval(expression_nr. 84 )
                 =================

dev.off()
curr.fun: symbol dev.off
quartz
     2
 .. after 'expression(dev.off())'


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

Anthony

R 1.9.0
Mac OS 10.3.3

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to