【发布时间】:2015-08-06 21:41:59
【问题描述】:
上周我从 Ubuntu 14.04 升级到 14.10。自更新以来,我第一次尝试在 RStudio 中使用 ggplot,我的 ggplot 包出现依赖错误,并且不再注册为已安装(之前工作正常)。当我尝试重新安装 ggplot2 时:
install.packages("ggplot2",dep=TRUE)
尝试安装依赖项时安装失败。输出的尾部如下所示:
* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
ERROR: lazy loading failed for package ‘stringr’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/stringr’
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
ERROR: dependency ‘stringr’ is not available for package ‘reshape2’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/reshape2’
Warning in install.packages :
installation of package ‘reshape2’ had non-zero exit status
ERROR: dependency ‘reshape2’ is not available for package ‘ggplot2’
* removing ‘/home/james/R/x86_64-pc-linux-gnu-library/3.1/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpWNyAha/downloaded_packages’
我觉得这是我应该查看的行(下方),但我不确定如何解释此错误,有人对我有什么建议吗?我真的不知道从哪里开始,因为我找不到任何其他人遇到与我相同的错误。
Error in library.dynam(lib, package, package.lib) :
shared object ‘stringi.so’ not found
不确定我所做的 Ubuntu 升级是否与此有关……但我想我会提一下以防万一。
【问题讨论】:
-
你应该使用引号:
install.packages("ggplot2", dependencies = TRUE). -
好收获!但这实际上只是我的问题中的一种类型,因为我确实包含了引号以获取我发布的输出。我已经更新了帖子。
-
尝试用
install.packages("stringi")重新安装包stringi -
似乎
dependencies = TRUE以ggplot2失败。所以,你需要install.packages("stringr", dep=TRUE),然后是install.packages("ggplot2", dep=TRUE)。 -
@Pascal:这是我的第一个想法,但依赖标志实际上工作正常。安装依赖包
stringr时出现错误。即使在运行install.packages("stringi")时,仍然会出现错误。 @尼克肯尼迪:太棒了!就是这样!我没有意识到stringi是一个包。安装该依赖包时出错。我在下面添加了一个答案,以显示我必须采取的最后步骤来解决它。