无法安装软件包(Windows)

时间:2014-05-29 08:58:41

标签: r

尝试在R中安装软件包会导致出现典型错误消息:

install.packages("plotrix")
## Installing package into ‘C:/Users/nevs/Documents/R/win-library/3.0’
## (as ‘lib’ is unspecified)
## package ‘plotrix’ is available as a source package but not as a binary
## Warning in install.packages :
## package ‘plotrix’ is not available (for R version 3.0.2)

针对尝试的每个包弹出此消息。请建议一个解决方案或另一种方法在Windows中将软件包安装到R. 系统信息:

> version
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          0.2                         
year           2013                        
month          09                          
day            25                          
svn rev        63987                       
language       R                           
version.string R version 3.0.2 (2013-09-25)
nickname       Frisbee Sailing        

2 个答案:

答案 0 :(得分:0)

解决方案:将R从3.0.2更新到3.1.0解决了这个问题。 有关如何使用Rstudio更新R的更多信息,请参阅this thread。 此错误的来源仍然未知。

答案 1 :(得分:0)

我有同样的问题,但我最近更新了应用程序。 对不起,我是R

编程环境的新手
install.packages("plotrix")

Installing package into ‘C:/Users/schal/OneDrive/ΞΞ³Ξ³Οαφα/R/win-library/3.3’
(as ‘lib’ is unspecified)
installing the source package ‘plotrix’

trying URL 'https://cran.rstudio.com/src/contrib/plotrix_3.6-3.tar.gz'
Content type 'application/x-gzip' length 224774 bytes (219 KB)
downloaded 219 KB

* installing *source* package 'plotrix' ...
** package 'plotrix' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/schal/OneDrive/N3N3ON1ON1/R/win-library/3.3/plotrix/DESCRIPTION': Invalid argument
Error in file(file, if (append) "a" else "w") : 
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'plotrix'
* removing 'C:/Users/schal/OneDrive/ΞΞ³Ξ³Οαφα/R/win-library/3.3/plotrix'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\schal\OneDrive\ΞΞ³Ξ³Οαφα\R\win-library\3.3" C:\Users\schal\AppData\Local\Temp\RtmpMbuRmt/downloaded_packages/plotrix_3.6-3.tar.gz' had status 1
Warning in install.packages :
installation of package ‘plotrix’ had non-zero exit status

The downloaded source packages are in
‘C:\Users\schal\AppData\Local\Temp\RtmpMbuRmt\downloaded_packages’

 > version
           _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          3.1                         
year           2016                        
month          06                          
day            21                          
svn rev        70800                       
language       R                           
version.string R version 3.3.1 (2016-06-21)
nickname       Bug in Your Hair