This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error when plotting on RStudio: Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error)

I am trying to plot something simple in Rstudio and this error shows up:

plot(cars)

Error in RStudioGD() :

Shadow graphics device error: r error 4 (R code execution error)

Además: Warning messages:

1: In grDevices:::png("C:/Users/Usuario/AppData/Local/Temp/RtmpuYmueE/bcbe775221654e0e80c35484134dae4c.png", : unable to open file 'C:/Users/Usuario/AppData/Local/Temp/RtmpuYmueE/bcbe775221654e0e80c35484134dae4c.png' for writing

2: In grDevices:::png("C:/Users/Usuario/AppData/Local/Temp/RtmpuYmue/bcbe775221654e0e80c35484134dae4c.png", : opening device failed

I tried updating R and Rstudio, and the problem is still there. I also manually installed the R tools manually and it still does not work.

I am working on Windows, if it makes any difference.

Any help would be welcome, I'm in complete loss.

r rstudio error plot

Following suggestion from @makrez try to recreate the temp folder: C:/Users/Usuario/AppData/Local/Temp/RtmpuYmueE

I already did that and the error still shows up, but this time with another name for the directory in the Temp folder...

0 answers

No answers yet.

Log in to answer this question.