本文介绍了OS X Yosemite升级后无法在R中加载X11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
升级到优胜美地后,尝试使用ggplot2并在控制台中进行绘图时,遇到以下错误:
Running into the following error when I try to use ggplot2 and plot within the console after upgrading to Yosemite:
Error in (function (display = "", width, height, pointsize, gamma, bg, :
X11 module cannot be loaded
In addition: Warning message:
In (function (display = "", width, height, pointsize, gamma, bg, :
unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6): Library not loaded: /usr/X11/lib/libSM.6.dylib
Referenced from: /Library/Frameworks/R.framework/Resources/modules//R_X11.so
Reason: image not found
我该如何解决这个问题?
How can I go about resolving this?
推荐答案
在终端窗口中执行以下操作:
Execute the following in a terminal window:
locate libSM.6.dylib
或从R控制台执行此操作:
or do it from an R console:
system("locate libSM.6.dylib")
在我的优胜美地安装中,它位于/opt/X11/lib/libSM.6.dylib
中.
On my Yosemite install it's in /opt/X11/lib/libSM.6.dylib
.
如果您的设置相似,则:
If your setup is similar, then:
sudo ln -s /usr/X11 /opt/X11
应该可以暂时解决此问题,但我会一直在寻找Yosemite R软件包(因为它将容纳Apple对文件系统结构所做的所有更改).
should help fix this temporarily, but I'd keep looking for a Yosemite R package (since that will accommodate all the changes Apple made to the filesystem structure).
这篇关于OS X Yosemite升级后无法在R中加载X11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!