如何修复此错误在R

时间:2017-10-25 06:48:31

标签: r install.packages

之前我参加过几门R课程,并希望继续学习它。然而,几个月前我不得不从零恢复我的计算机(一台Windows 8的HP),我安装了R的一个lastests版本(不记得具体的)和Rstudio,当我试图安装包时(大多数情况下,我一直在尝试使用dplyr包,但是我尝试过的任何包都会返回类似的消息)

install.packages("dplyr")

它检索到一个错误,说明为旧版本(3.2.2)构建了包(或类似的东西),因此我将版本更改为3.2.2。我尝试使用相同的代码再次安装包并检索下一个错误(在大量“尝试URL”消息之后):

The downloaded binary packages are in
C:\Users\Víctor\AppData\Local\Temp\RtmpYRSybZ\downloaded_packages
installing the source packages ‘R6’, ‘BH’
* installing *source* package 'R6' ...
** package 'R6' successfully unpacked and MD5 sums checked
Warning in file(file, ifelse(append, "a", "w")) :
  cannot open file 'C:/Users/Vmctor/Documents/R/win-library/3.2/R6/DESCRIPTION': No such file or directory
Error in file(file, ifelse(append, "a", "w")) : 
  no se puede abrir la conexión
ERROR: installing package DESCRIPTION failed for package 'R6'
* removing 'C:/Users/Víctor/Documents/R/win-library/3.2/R6'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Víctor\Documents\R\win-library\3.2" C:\Users\VCTOR~1\AppData\Local\Temp\RtmpYRSybZ/downloaded_packages/R6_2.2.2.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘R6’ had non-zero exit status
* installing *source* package 'BH' ...
** package 'BH' successfully unpacked and MD5 sums checked
Warning in file(file, ifelse(append, "a", "w")) :
  cannot open file 'C:/Users/Vmctor/Documents/R/win-library/3.2/BH/DESCRIPTION': No such file or directory
Error in file(file, ifelse(append, "a", "w")) : 
  no se puede abrir la conexión
ERROR: installing package DESCRIPTION failed for package 'BH'
* removing 'C:/Users/Víctor/Documents/R/win-library/3.2/BH'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Víctor\Documents\R\win-library\3.2" C:\Users\VCTOR~1\AppData\Local\Temp\RtmpYRSybZ/downloaded_packages/BH_1.65.0-1.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘BH’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Víctor\AppData\Local\Temp\RtmpYRSybZ\downloaded_packages’

我注意到部分错误消息包含库路径的不同拼写,例如C:/ Users / Vmctor ...和C:\ Users \ VCTOR~1

> .libPaths()
[1] "C:/Users/Víctor/Documents/R/win-library/3.2" "C:/Program Files/R/R-3.2.2/library"

鉴于该目录包含字符“í”,我认为这是问题的原因,所以我创建了一个新用户来创建一个没有重音的新路径

> .libPaths()
[1] "C:/Users/victor2/Documents/R/win-library/3.2"
[2] "C:/Program Files/R/R-3.2.2/library"

我尝试在这个新用户中安装软件包,这次返回的消息没有提到文件路径,简而言之,检索到的消息包含下一个(在“尝试U​​RL”消息之后):

Binaries will be installed
Package which is only available in source form, and may need compilation of
  C/C++/Fortran: ‘rlang’
  These will not be installed
The downloaded binary packages are in
C:\Users\victor2\AppData\Local\Temp\Rtmpao93L4\downloaded_packages

如果我尝试使用该软件包,则会出现:

> library(dplyr)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘DBI’
In addition: Warning message:
package ‘dplyr’ was built under R version 3.2.5 
Error: package or namespace load failed for ‘dplyr’

有谁知道问题是什么,或者可以告诉我在哪里可以找到有关它的信息?

谢谢。

0 个答案:

没有答案
相关问题