So, I know that this was asked and answered before, but the answers to them did not help solve my problem, so I hope that new conclusions have come up with this problem, and someone can help me with this.
I am running RStudio on Ubuntu 12.04 lts and with R version 3.2.2 (2015-08-14). When I try to use the plot function, I get the following error message:
> plot(cars) Error in RStudioGD() : Shadow graphics device error: r error 4 (R code execution error) In addition: There were 50 or more warnings (use warnings() to see the first 50)
warnings () gives me:
Warning messages: 1: In grDevices:::png("/tmp/RtmpOdYXyC/1ec8e69b4b2b4902818e02cd828dbf5e.png", ... : failed to load cairo DLL 2: In grDevices:::png("/tmp/RtmpOdYXyC/a4885ae9c7b846698a638ca9c65e2632.png", ... : failed to load cairo DLL 3: In grDevices:::png("/tmp/RtmpOdYXyC/91faf2840f694bef8d04409cdc64e5c9.png", ... : failed to load cairo DLL 4: In grDevices:::png("/tmp/RtmpOdYXyC/4f77d036b3bc4e9f815d1aa8c8d834da.png", ... : failed to load cairo DLL 5: In grDevices:::png("/tmp/RtmpOdYXyC/e2f473f06d904168ab34a3efb0793389.png", ... : failed to load cairo DLL 6: In grDevices:::png("/tmp/RtmpOdYXyC/6904947cbaac4bec835e3d6c3c7beffb.png", ... : failed to load cairo DLL > 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 TRUE TRUE FALSE TRUE FALSE
I had previously run Rstudio with r-base software downloaded from the ubuntu software center, and had never encountered this problem.
Since I needed to download several packages that were not supported by this version, I decided to download the latest version (3.2.2) from my browser so that I could download the necessary packages.
Now I can not use a simple function such as plot. I went through the stack and saw that many people encountered this problem, but I have not yet found a solution to my problem. I tried to uninstall and reinstall everything, as one of the answers said, but this did not work for me, I still get the same error.
Many forums have asked the following:
> sessionInfo() R version 3.2.2 (2015-08-14) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu precise (12.04.5 LTS) locale: [1] LC_CTYPE=en_IN.UTF-8 LC_NUMERIC=C LC_TIME=en_IN.UTF-8 LC_COLLATE=en_IN.UTF-8 LC_MONETARY=en_IN.UTF-8 [6] LC_MESSAGES=en_IN.UTF-8 LC_PAPER=en_IN.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] highfrequency_0.4 xts_0.9-7 zoo_1.7-12 loaded via a namespace (and not attached): [1] tools_3.2.2 grid_3.2.2 lattice_0.20-33 > 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 TRUE TRUE FALSE TRUE FALSE > png(); dev.off() Error in png() : X11 module cannot be loaded > x11() Error in x11() : X11 module cannot be loaded > Sys.getenv("DISPLAY") [1] ":0.0"
Can someone shed light on this problem. Any help would be appreciated.
Please let me know if you need more information.