Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Error: Shadow graphics device error

Tags:

graph

r

yes I know there are many threads to this above mentioned error, but (at least I) wasn't able to find a solution. So RStudio gives me the following error while trying to plot something:

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

It seems to be a problem with R supporting jpeg and png. Running in R environment

    >capabilities()
    jpeg         png        tiff       tcltk         X11        aqua 
    FALSE       FALSE       FALSE       FALSE       FALSE       FALSE
    http/ftp     sockets      libxml        fifo      cledit       iconv 
    TRUE        TRUE        TRUE        TRUE       FALSE        TRUE 
    NLS     profmem       cairo         ICU long.double     libcurl 
    TRUE       FALSE       FALSE        TRUE        TRUE        TRUE 

shows exactly that. cairo and pango are installed. And I have no idea what else to do. Here you can find the code I'm trying to run. I installed the packages magrittr, ggplot2, dplyr, cowplot and patchwork. Furthermore I'm running the latest RStudio version on linux. R itself is also updated.

Thanks in advance.


EDIT: For anyone stumbling over the same problem: A complete re-installation of R, RStudio and most depencies solved the problem somehow.

like image 893
franzhc Avatar asked Aug 06 '26 22:08

franzhc


1 Answers

A bit late, but today I had the same problem. I restarted my session with Ctrl + Shift + F10 and it worked.

like image 113
Federico de Leon Avatar answered Aug 09 '26 14:08

Federico de Leon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!