尝试安装dplyr时R的异常行为

时间:2019-02-15 07:12:47

标签: r dplyr installation

我正在按照网络上的相关建议,尝试更新dplyr软件包以解决rlang的问题。

首先,我使用remove.packages()命令删除了先前安装的dplyr。

然后我重新启动R Studio。

这是故事的其余部分:

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

[...]

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RevoUtilsMath_10.0.0 RevoUtils_10.0.5     RevoMods_11.0.0      MicrosoftML_1.5.0    mrsdeploy_1.1.2     
[6] RevoScaleR_9.2.1     lattice_0.20-35      rpart_4.1-11        

loaded via a namespace (and not attached):
 [1] codetools_0.2-15       CompatibilityAPI_1.1.0 foreach_1.4.4          grid_3.4.1             R6_2.2.2              
 [6] jsonlite_1.5           curl_2.6               iterators_1.0.8        tools_3.4.1            yaml_2.1.14           
[11] compiler_3.4.1         mrupdate_1.0.1  

> library(dplyr)
Error in library(dplyr) : there is no package called ‘dplyr’

> install.packages('dplyr', dependencies = TRUE)
Installing package into ‘C:/Users/Alienware/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://mran.microsoft.com/snapshot/2017-09-01/bin/windows/contrib/3.4/dplyr_0.7.2.zip'
Content type 'application/zip' length 2881528 bytes (2.7 MB)
downloaded 2.7 MB

package ‘dplyr’ successfully unpacked and MD5 sums checked
Warning in install.packages :
  cannot remove prior installation of package ‘dplyr’

The downloaded binary packages are in
    C:\Users\Alienware\AppData\Local\Temp\RtmpucBaSk\downloaded_packages

> library(dplyr)
Error in library(dplyr) : there is no package called ‘dplyr’

1 个答案:

答案 0 :(得分:0)

转到您的R库路径(存储软件包的位置):

C:\Users\username\Documents\R\win-library\3.5

有关如何查找R库路径的信息,请参阅this指南。

接下来,只需在您的文件夹中搜索dplyr并将其删除。我发现这种手动方法对我有用,而不是通过Rstudio删除包装。希望对您有帮助!