Hi.

I'm running R OS X GUI 1.35-dev Leopard build 64-bit.  When I run the following code (snippet from a larger code) from the GUI I obtain 2 separate *.pdf files as you would expect from the high-lighted code.  However, when I run from Rscript (command-line), I only get the first one.  No errors appear in the console log however I do get a 'null device' message that I don't understand.  It's probably related but I have no clue how to debug this.  Perhaps the second output file is not getting initialized?  I've tried a few variations to see if I can unearth the cause but no joy so far.  Any suggestions would be appreciated.

Thanks.
...

profiles.spl <- smooth.spline(x, y)
(profiles.spl)
x_pred = seq(1,as.integer(max(x)))
B = data.frame(predict(profiles.spl,x_pred))
pdf(file=paste("/Volumes/SLR_Data_001/USN_SERDP_SLR/data/level1/beach_profiles_Flick/",Filename,".pdf",sep=""))
caption = paste(aLocation," (", aYear,".",aMonth,".",aDay,")",sep="")
credits = paste("splineWriter.R / hellyj@ucsd.edu / 20110120")
xrng = range(x)
yrng = range(y)
pred = qplot(x,y, data=B, xlab="Distance (m)", ylab = "Elevation (m)", xlim=c(0,1000), ylim=c(-12,4))
pred + geom_text(aes(700,2,label=caption)) + geom_text(aes(180,-12,label=credits),size=2.7)
dev.off() 
## Residual (Tukey Anscombe) plot:
pdf(file=paste("/Volumes/SLR_Data_001/USN_SERDP_SLR/data/level1/beach_profiles_Flick/",Filename,"TA.pdf",sep=""))
qplot(fitted(profiles.spl), residuals(profiles.spl))
dev.off()

...

--------------
John Helly, University of California, San Diego / San Diego Supercomputer Center / Scripps Institution of Oceanography / stonesteps (Skype) / stonesteps7 (iChat) / http://www.sdsc.edu/~hellyj
	[[alternative HTML version deleted]]

