我最近刚刚将我的Rstudio更新到0.98.1103版本,现在我无法加载ggplot它不断抛出以下错误。有什么想法发生了什么?
> library(ggplot2)
Error : .onLoad failed in loadNamespace() for 'tcltk', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/tcltk/libs/tcltk.so, 10): Library not loaded: /usr/X11/lib/libXft.2.dylib
Referenced from: /usr/local/lib/libtk8.6.dylib
Reason: image not found
Error: package or namespace load failed for ‘ggplot2
我尝试删除tcltk库和ggplot2并重新安装它们现在我得到了一组不同的错误:
> library(ggplot2)
Error : package ‘tcltk’ does not have a namespace
Error: package or namespace load failed for ‘ggplot2’
> library(tcltk)
Error in library(tcltk) : ‘tcltk’ is not a valid installed package
答案 0 :(得分:1)
好像系统上没有安装X11。如果您使用的是OSX,请尝试安装xorg
(如果您正在运行Linux)或XQuartz
。