简体   繁体   中英

Installing R package spacetime

Hoping someone can assist. I updated R to 3.2.0 yesterday and cannot fix problems with installing the package "spacetime". I have already tried uninstalling and re-installing in case this would fix it. I think the problem has something to do with the package "sp" but do not understand the error message and my searches have been unsuccessful.

 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

I suspect that the wrong version of "sp" is being installed, but I thought I needed the latest version, so not sure I'm reading that correctly.

Check if the correct binaries are on CRAN/a different mirror. If they are, get them from there. Else you can install from source (you'll need Rtools) or wait until the binaries get updated.

Sometimes mirrors can lag a bit behind.

The reason for your trouble seems to be that spacetime expects sp version 1.1-0, but somehow install.packages only finds binaries for version 1.0-17. sp installs, but then spacetime fails, because it does not find the appropriate version of sp .

I have checked that on CRAN, Windows binaries for sp 1.1-0 exist: http://cran.r-project.org/web/packages/sp/index.html . Try to download sp_1.1-0.zip and then install it by using:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM