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.
Maybe this helps: https://github.com/rstudio/rstudio/issues/2214
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...