ggplot2采购错误:缺少X11库 [英] ggplot2 sourcing error: X11 library is missing
问题描述
我正在尝试为R加载ggplot2库.
I'm trying to load ggplot2 library for R.
1)我已经通过此命令安装了ggplot2.它安装没有错误
1) I've installed ggplot2 by this command. It was installed with no errors
install.packages('ggplot2', dependencies = TRUE)
2)然后我正在尝试使用
2) Then i'm trying to use
library(ggplot2)
并得到一个错误
错误:.onLoad在loadNamespace()上添加了"tcltk",错误: 标记:fun(libname,pkgname)注释:缺少X11库:安装 来自xquartz.macosforge.org的XQuartz. илипространстваимендля‘ggplot2’
Error : .onLoad не удалось в loadNamespace() для 'tcltk', подробности: вызов: fun(libname, pkgname) ошибка: X11 library is missing: install XQuartz from xquartz.macosforge.org Ошибка: не удалась загрузка пакета или пространства имен для ‘ggplot2’
3)现在,我尝试通过
3) Now i try to install XQuartz library by
install.packages("XQuartz")
得到这个
install.packages中的警告:软件包"XQuartz"不可用 (对于R版本3.1.2)
Warning in install.packages : package ‘XQuartz’ is not available (for R version 3.1.2)
我的R版本3.1.2 OS X优胜美地10.10.2
My R version 3.1.2 OS X Yosemite 10.10.2
您能帮我安装ggplot2 pls吗?
Can you help me in installing ggplot2 pls?
推荐答案
操作系统更新删除了/usr/X11和/usr/X11R6符号链接.我只需要从 macosforge 重新安装XQuartz,这将再次设置符号链接.
The OS update deleted the /usr/X11 and /usr/X11R6 symlinks. I had to just re-install XQuartz from macosforge which will setup the symlinks again.
这篇关于ggplot2采购错误:缺少X11库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!