安装R包时空

时间:2015-04-25 07:17:37

标签: r install.packages

希望有人可以提供帮助。我昨天将R更新为3.2.0并且无法解决安装软件包" spacetime"的问题。我已经尝试过卸载并重新安装以防万一这会解决它。我认为问题与包装有关" sp"但不明白错误消息,我的搜索不成功。

 install.packages("spacetime")
    Installing package into ‘C:/####/R/win-library/3.2’
    (as ‘lib’ is unspecified)
    also installing the dependency ‘sp’


  There are binary versions available but the source versions are later:
          binary source needs_compilation
sp        1.0-17  1.1-0              TRUE
spacetime  1.1-3  1.1-4             FALSE

  Binaries will be installed
trying URL 'http://cran.ms.unimelb.edu.au/bin/windows/contrib 
 /3.2/sp_1.0-17.zip'
Content type 'application/zip' length 1498250 bytes (1.4 MB)
 downloaded 1.4 MB

package ‘sp’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\###\downloaded_packages
installing the source package ‘spacetime’

trying URL 'http://cran.ms.unimelb.edu.au/src/contrib
/spacetime_1.1-4.tar.gz'
Content type 'application/x-gzip' length 3013768 bytes (2.9 MB)
downloaded 2.9 MB

* installing *source* package 'spacetime' ...
** package 'spacetime' successfully unpacked and MD5 sums checked
** R
** data
** demo
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])     : 
  namespace 'sp' 1.0-17 is being loaded, but     = 1.1.0 is required
ERROR: lazy loading failed for package 'spacetime'
* removing 'C:####/R/win-library/3.2/spacetime'

The downloaded source packages are in
        ‘C:\###\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" CMD INSTALL -l     "C:\####\R\win-library\3.2" C:####/downloaded_packages     /spacetime_1.1-4.tar.gz' had status 1 
2: In install.packages("spacetime") :
  installation of package ‘spacetime’ had non-zero exit status

我怀疑错误的版本" sp"正在安装,但我认为我需要最新版本,所以不确定我是否正确阅读。

2 个答案:

答案 0 :(得分:4)

检查CRAN /另一个镜像上是否有正确的二进制文件。如果他们是,从那里得到他们。否则你可以从源代码安装(你需要Rtools)或等到二进制文件更新。

有时镜子会落后一点。

答案 1 :(得分:1)

您遇到麻烦的原因似乎是spacetime期望sp版本1.1-0,但不知何故install.packages只找到版本1.0-17的二进制文件。安装sp,但spacetime失败,因为它找不到sp的相应版本。

我在CRAN上检查过,sp 1.1-0的Windows二进制文件存在:http://cran.r-project.org/web/packages/sp/index.html。尝试下载sp_1.1-0.zip,然后使用以下命令安装它:

install.packages("path_to_your_file/sp_1.1-0.zip",repos=NULL)