一段时间以来,我遇到了一个问题,在该问题中,直到我将其安装干净之前,我才能加载stringi软件包。只要我在一个R会话中,这似乎就可以工作。然后,过了一段时间,也许当我创建一个新会话时,或者可能是在更长的延迟之后,我不得不再次安装它。
今天早晨,由于某种原因,一切都中断了。现在,如果我可以立即安装并加载它,但是ggplot2无法识别它。具体来说,当我尝试安装ggplot2时,我得到了:
> library(stringi)
> install.packages("ggplot2")
Installing package into ‘/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/ggplot2_3.0.0.tar.gz'
Content type 'application/x-gzip' length 2847050 bytes (2.7 MB)
==================================================
downloaded 2.7 MB
* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so':
/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/libs/Rcpp.so: undefined symbol: R_ContinueUnwind
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/ggplot2’
* restoring previous ‘/home/bensmith/R/x86_64-pc-linux-gnu-library/3.4/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpEStEk4/downloaded_packages’
如您所见,stringi已成功加载到环境中,但是在安装ggplot2时出现此错误。
Elsewhere已通过安装stringi修复了此问题,但是在此无济于事。但是我怀疑stringi安装有问题,因为以前我不得不不断地重新安装它。
我曾尝试使用以下方法安装stringi和ggplot2
install.packages("stringi", type = "source")
install.packages("ggplot2", type = "source")
再次安装stringi,但不会安装ggplot2。
答案 0 :(得分:0)
似乎再次安装了Rcpp,从而解决了该问题。 感谢https://community.rstudio.com/t/stringi-installation-not-recognized-consequently-ggplot-wont-install/11590
的评论者