0

希望有人可以提供帮助。我昨天将 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”,但我认为我需要最新版本,所以不确定我是否正确阅读。

4

2 回答 2

4

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

有时镜子可能会落后一点。

于 2015-04-25T08:28:19.110 回答
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)
于 2015-04-25T08:29:05.033 回答