[R] Installing sp and rgdal libraries

Gavin Simpson gavin.simpson at ucl.ac.uk
Thu Sep 30 11:43:44 CEST 2010


On Thu, 2010-09-30 at 00:40 -0700, Gary Nobles wrote:
> Hi,
> 
> I am still a bit of a beginner with R but I had it all working spgrass6,
> RMySQL, sp, etc...
> 
> Then I wanted to install spatstat, this required updating R, all was going
> fine until I tried to connect to grass gis using spgrass6 library, it
> wouldn't let be install the package due to a dependency with rgdal. rgdal
> will not install as the sp package is 1:0.9-56-2 and sp requires a higher
> version. I can not find a higher version.
> 
> Here is the error upon install.packages("rgdal")
> 
> ** preparing package for lazy loading
> Error : package 'sp' 0.9-56 was found, but >= 0.9.60 is required by 'rgdal'
> ERROR: lazy loading failed for package ârgdalâ
> * removing â/home/gary/R/x86_64-pc-linux-gnu-library/2.10/rgdalâ
> 
> The downloaded packages are in
>         â/tmp/RtmpCtm6wH/downloaded_packagesâ
> Warning message:
> In install.packages("rgdal") :
>   installation of package 'rgdal' had non-zero exit status
> 
> I would really like to learn and use R as it has so much time saving
> potential as well as some great innovative functions which I can't find
> anywhere else. Especially as it can link to grassgis.
> 
> Thank you for any help you can offer
> 
> Gary
> 

When you updated R (to what version?) did you also update your package
library?

update.packages(checkBuilt = TRUE)
## add ask = FALSE if you just want it to do it
## update.packages(checkBuilt = TRUE, ask = FALSE)

will normally suffice.

The error message indicates you already have the sp package installed
but the version you have is too old for the version of rgdal you are
trying to install.

You could also try

install.packages("rgdal", depend = TRUE, lib = "path/to/library")

when doing the installation, but I don't recall now whether that will
check the version of installed packages and install [new versions of]
them if necessary.

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list