loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) 错误:没有名为“Rcpp”的包

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘Rcpp’

基本上我想使用wordcloud功能。我正在通过 R 控制台工作。但如果那是问题所在,我可以使用 Rstudio。

当我使用

 wordcloud(r_stats_text_corpus)
 Error: could not find function "wordcloud"

我也试过了

library("wordcloud")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘Rcpp’
Error: package or namespace load failed for ‘wordcloud’

然后:

install.packages("Rcpp")
Installing package into ‘C:/Users/Abbas/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://pbil.univ-lyon1.fr/CRAN/bin/windows/contrib/3.2/Rcpp_0.12.3.zip'
Content type 'application/zip' length 3197148 bytes (3.0 MB)
downloaded 3.0 MB

package ‘Rcpp’ successfully unpacked and MD5 sums checked

Warning: unable to move temporary installation ‘C:\Users\Abbas\Documents\R\win-library.2\file2388511e56ac\Rcpp’ to ‘C:\Users\Abbas\Documents\R\win-library.2\Rcpp’
The downloaded binary packages are in
        C:\Users\Abbas\AppData\Local\Temp\RtmpwrnScP\downloaded_packages

当我检查路径时 C:\Users\Abbas\Documents\R\win-library.2\file2388511e56ac\Rcpp 我只能找到空文件夹。我仍然将此文件夹移动到 C:\Users\Abbas\Documents\R\win-library.2\Rcpp。即使在此之后,当我尝试加载 Rcpp 包时,我也会收到错误消息。

library("Rcpp")
Error in library("Rcpp") : there is no package called ‘Rcpp’

同样在检查路径 C:\Users\Abbas\AppData\Local\Temp\RtmpwrnScP\downloaded_packages 时,我可以在那里看到压缩文件 Rcpp_0.12.3。

求助!

编辑:当我通过 Rstudio 尝试这个时,我在这里遗漏了什么?

> install.packages(Rcpp)
Error in install.packages : object 'Rcpp' not found
> source('~/.active-rstudio-document', echo=TRUE)

感谢您的帮助。我得到了修复! 手动将 Rcpp zip 文件解压缩到 .libPaths()

中提到的路径