[R] dev.new() throws error from command line

Bert Gunter bgunter.4567 at gmail.com
Fri Mar 18 16:32:23 CET 2016

1. This is just a semi-educated guess on my part -- hopefully you'll
get a better response from someone else. But consider:

2. Read carefully the "dev.new" section of ?dev. My guess on that
basis is that the default given by getOption("device") is set in your
R window, but not in a command line script. So you might try
explicitly setting it in your script first and see if that fixes

3. I have no idea why this should have changed from earlier versions.
Perhaps a bug???

4. Please again note point1. Ny guess could be complete nonsense. Caveat emptor!


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Fri, Mar 18, 2016 at 7:42 AM, Michael Ashton
<m.ashton at enduringinvestments.com> wrote:
> I am running in Windows 8. I noticed this particular problem running a script in R 2.9.2 from the command line.
> I have an r script that I wrote some time ago. It is fairly complicated and does a lot of time-consuming optimizations, following which it populates a SQL database with the results. The whole thing takes maybe 10-15 minutes to run.
> Because it takes a while to run, I have it automatically kicking off in the early morning using a command-line instruction from System Scheduler.
> The script ran fine for a long time...actually, for a few years. Recently, it started to run but kill out at one point. When I run it from a new R session, manually pasting in the script, it runs fine.
> After some elementary debugging I discovered that the error is happening when I call dev.new() . Again, this never had a problem before, and it doesn't have a problem when run in the R window, but when the script is run in the command line it throws this error:
> "no suitable unused file name for pdf()"
> No idea what this means as I'm not calling a pdf device...unless somehow when it's command-line R assumes you don't want a window but a pdf. If that's the case I still can't figure out why there's suddenly a problem finding "unused file names."
> Any suggestions would be welcome!
> Thanks,
> Mike
> Michael Ashton, CFA
> Managing Principal
> Enduring Investments LLC
> W: 973.457.4602
> C: 551.655.8006
> ________________________________
> This email and any attachments are confidential and inte...{{dropped:9}}
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

More information about the R-help mailing list