On Jul 1, 2013, at 14:35 , Adrian Trapletti wrote: > Dear all, > > I am comparing "R CMD BATCH script.R" with running the following code snippet > within R: > > pdf("Rplots.pdf") > source("script.R") > dev.off() > q(save="no") > > Among other things, one difference is that the former produces no Rplots.pdf > while the latter produces an empty Rplots.pdf, if script.R does not contain > "plotting" commands (R version 3.0.1, i486-pc-linux-gnu (32-bit)). What is > the difference between the two with respect to pdf plotting?
Same as on the command line: If you type quartz() (or whatever is the default device for you), you get an empty window if no plotting follows. If you type plot(0:9), the quartz() device is opened for you and plotted into. You could try options(device=pdf) source("script.R") q(save="no") -- Peter Dalgaard, Professor Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd....@cbs.dk Priv: pda...@gmail.com ______________________________________________ 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.