[英]R crashes when trying to output/create plot
All of a sudden my system does no want to create plots from inside an R environment.突然之间,我的系统不想从 R 环境中创建绘图。
When I do just something simple like:当我做一些简单的事情时:
>$R
>X11()
(I can use whatever plotting function of RI want to. Not only X11()) (我可以使用 RI 的任何绘图功能。不仅是 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.它不仅冻结了窗口本身,还冻结了底层的 R 会话。 The only way to get out is to xkill the plot window.唯一的出路是 xkill 绘图窗口。
After doing that inside R this message pops up:在 R 中执行此操作后,会弹出此消息:
Error in X11() : X11 fatal IO error: please save work and shut down R X11() 中的错误:X11 致命 IO 错误:请保存工作并关闭 R
I have Googled through several things but I am not able to solve this.我已经通过谷歌搜索了几件事,但我无法解决这个问题。 I am working on a CentOS6.7 OS.我正在开发 CentOS6.7 操作系统。
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包含一行以使用ggsave将绘图保存到特定文件位置
Save your script from RStudio and quit/kill your session从 RStudio 保存您的脚本并退出/终止您的会话
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查看您在上面步骤 1 中指定的文件位置中的绘图
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.