安装 R 包时空

Installing R package spacetime

希望有人能提供帮助。我昨天将 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.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" 安装了错误的版本,但我认为我需要最新版本,所以不确定我是否正确阅读。

检查 CRAN/a 不同的镜像上是否有正确的二进制文件。如果是,请从那里获取它们。否则您可以从源代码安装(您需要 Rtools)或等到二进制文件更新。

有时镜像会有点滞后。

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

版本

我已经检查过在 CRAN 上,Windows sp 1.1-0 的二进制文件存在: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)