-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error) #2214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ArRstudio Are you able to run |
@ArRstudio It looks like this is being handled by our professional Support Team (issue 25469) so I'm am going to close it in this queue. |
Same issue here:
Another RStudio instance works but this instance fails. |
I use RStudio Version 1.1.463 – © 2009-2018 RStudio, Windows 10 have the same issue |
The error most likely implies that RStudio / your user account does not have write access to your Temp folder for some reason. Unfortunately figuring out why this is the case could be very challenging. |
I experienced the same error; thanks for @kevinushey for hinting at missing write access! The problem was gone and plotting back to normal when I recreated the temp folder (in my case the |
@werner-rammer |
The last folder in the path did not exist. Re-creating the folder has solved the issue for me. |
If I understand correctly, this issue is occurring because something is deleting the R temporary directory in your session? AFAIK this shouldn't happen normally, but we could try to recover by auto-recreating the directory as needed... |
Sometimes I will start a project and, when I have a break, I will just close the laptop lid. Maybe temp files are erased as Windows goes into standby. |
@kevinushey : yes, re-creating the folder if missing would solve the issue. It does not always happen when Windows goes into standby, and my guess is that it is related to Windows updates (but really just a guess). By the way: QGis has a very similiar issue (saving of a project fails when the temp directory is gone). |
Error in RStudioGD() : |
thank you! it worked |
You just need to create a folder on Temp called "RtmpEHFUSu" and it'll work. |
The fix for this, #6722, should be in the 1.4 Wax Begonia dailies. Note, though, that the dailies are meant for testing purposes only. |
the same error on CentOS
But the /tmp/ dir exists, the file is empty:
And output to pdf files works fine:
|
Still getting bitten by this in 2021, RStudio 1.4.1103 - with successful access to tmp dir: > plot(1:100,sin(1:100))
Error in RStudioGD() :
Shadow graphics device error: r error 4 (R code execution error)
In addition: Warning message:
In grDevices:::png("/tmp/RtmpUBSVJV/87eb593bd19f4d58977ff56c6c73f42e.png", :
unable to open connection to X11 display '' |
Is R compiled with support for Cairo? What is the output of |
@kevinushey They seem Ok: > capabilities()
jpeg png tiff tcltk X11 aqua http/ftp sockets libxml fifo cledit iconv
TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE TRUE TRUE
NLS profmem cairo ICU long.double libcurl
TRUE FALSE TRUE FALSE TRUE TRUE
> Sys.getenv("DISPLAY")
[1] ":0" I can also |
Under the Tools menu is the Global Options... command that lets you set the graphics backend (under the General section, Graphics tab). Changing the graphics device backend to "Cairo" made this error go away for me. |
@enbrown Thanks! It just reproduced again, and your advice solved it. |
@kevinushey I believe I have a consistent repro for this:
Merely opening "Tools/global options/General/Graphics" and clicking 'Ok' (Backend Cairo was already selected) solves it. |
@OfekShilon I wasn't able to reproduce locally, but it might be useful to see how
and then try to reproduce your issue after plotting. |
@kevinushey Here are the tracing results:
It still reproduces consistently for me. If there's more stuff you want to check I'll be happy to try. |
Weird... does it also reproduce if you use a plain old call to e.g. |
@kevinushey yep:
|
Then whatever happens seems to be independent of RStudio. I'd use the R debugger to step through |
@kevinushey Indeed, on a 'good' machine |
@kevinushey Another bit: |
Hi @ALL, type = "cairo" is unavailable. trying "Xlib" I change the access of /tmp file with 777, but it doesn't work. |
QA NoteI am currently unable to reproduce this issue. |
This has not been reproed internally, and Kevin believes this is a problem in R, not RStudio. Closing this issue. |
Thanks, this works for me |
thank you very much!it worked! |
It works for me. Thank u |
@werner-rammer How did you re-create the tmp folder please? Delete it and re-run command that lets it re-create it? |
Well, the error message refers to a directory which does not exist anymore. Go the the folder, create a directory with the name given by the error message, and run the R code again. This worked for me on Windows. |
This worked! |
System details
Steps to reproduce the problem
plot(cars)
Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error) In addition: Warning message: In grDevices:::png("/tmp/RtmpEdEj7l/642098b8481c4db7820081c92f4117e7.png", : unable to open connection to X11 display ''
Describe the problem in detail
i am trying to run plot(cars) on rstudio application ,receiving this below error
plot(cars)
Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error) In addition: Warning message: In grDevices:::png("/tmp/RtmpEdEj7l/642098b8481c4db7820081c92f4117e7.png", : unable to open connection to X11 display ''
Describe the behavior you expected
The text was updated successfully, but these errors were encountered: