All of a sudden my system does no want to create plots from inside an R environment.
When I do just something simple like:
>$R
>X11()
(I can use whatever plotting function of RI want to. Not only X11())
A new windows pops open just like expected but then freezes. It not only freezes the window itself it also freezes the underlying R session. The only way to get out is to xkill the plot window.
After doing that inside R this message pops up:
Error in X11() : X11 fatal IO error: please save work and shut down R
I have Googled through several things but I am not able to solve this. I am working on a CentOS6.7 OS.
sessionInfo()
>R version 3.2.2 (2015-08-14)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS release 6.7 (Final)
>locale:
> [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C
> [3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8
> [5] LC_MONETARY=en_US.utf8 LC_MESSAGES=en_US.utf8
> [7] LC_PAPER=en_US.utf8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
>[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C
>attached base packages:
>[1] stats graphics grDevices utils datasets methods base `
Try the following:
Include a line to use ggsave to save the plot to a specific file location
Save your script from RStudio and quit/kill your session
Open a terminal, navigate to the folder with your script, and run it with:
Rscript your_code.R
View the plot in the file location you specified in step 1 above
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.