Reputation: 43
First, the error:
Error in (function (file = if (onefile) "Rplots.pdf" else "Rplot%03d.pdf", :
cannot open file 'Rplots.pdf'
This error occurs on any invocation of plot(), including plot(1).
It had functioned correctly for a while, but then it stopped and began to throw this error.
I am running this on R Studio - Server Version 1.0.136 with R version 3.4.0 (2017-04-21). All packages have been updated to the latest version.
What broke? I tried reinstalling 'graphics' but it wouldn't let me. Do I have to reinstall R?
As requested, the code that produces this error:
plot(1)
This error persists across restarting R, restarting R studio, rebooting the server, reinstalling base r, and an unplanned power outage.
Upvotes: 0
Views: 399
Reputation: 91
Resaving the code with a new filename resolves the problem, however, you will have to rename it for each subsequent run.
Hopefully someone has a better answer out there.
Upvotes: 0
Reputation: 43
I've tried multiple things to resolve this and eventually the nuclear option worked.
The problem was the output device was assigned to plot()
somehow. getOption("device")
should output the definition of the function plot()
. If you have this issue, reassigning the graphics output to RStudio will not fix it, and calling to dev.off()
won't either.
This was resolved with a reinstall of R Studio Server and base-r.
Best of luck!
Upvotes: 1