[R-sig-Geo] difficulty loading package "sp"

Roger Bivand Roger.Bivand at nhh.no
Sun Nov 21 12:14:30 CET 2010


On Sat, 20 Nov 2010, Mike Marsh wrote:

> Hello all,
> This is my first message to this list.
> I'm reading "Applied spatial data analysis with R", and trying to
> install "sp".
> I went to http://cran.r-project.org/ then to  Packages, but did not find
> "sp"
> I found and downloaded sp_0.9-72.zip
> <http://cran.r-project.org/bin/windows/contrib/r-release/sp_0.9-72.zip>from
> the page linked to CRAN Task View Analysis of Spatial Data, moved the
> zipped package to my library folder under R-2.8.1, and unzipped it,
> obtaining folder sp_0.9-72 I opened R in folder library, and called

No, this is not how you install binary contributed packages on Windows. 
You use the Packages -> menu item, choosing sp from the (long) list that 
appears after you have chosen a CRAN mirror. Alternatively, you can simply 
enter install.packages("sp") at the console prompt, you will be asked for 
a CRAN mirror. Never mess with the R library folders, its contents and 
index are updated within R, and are not for users to meddle with.

You are also running R 2.8.1 (current is 2.12.0), so installing manually 
(had you done it properly by downloading the correct zip archive and using 
the Packages -> Install from local zip file option) would only work for 
the 2.8 binary build of the package:

http://cran.r-project.org/bin/windows/contrib/2.8/sp_0.9-37.zip

but this should be selected automatically if you use the system correctly.

Hope this helps,

Roger

>
> > library(sp)
> Error in library(sp) : there is no package called 'sp', version 0.9-72
> then I tried
> > library(sp_0.9-72)
> Error in library(sp_0.9 - 72) : 'package' must be of length 1
> then I opened sp 0.9.-72 and moved folder sp to be under the parent
> directory, library
> > > library(sp)
> Error: This is R 2.8.1, package 'sp' needs >= 2.10.0
>
> I tried "update.package"
>
> > update.packages(sp)
> Error in update.packages(sp) : object "sp" not found
> >
> I then tried Update Packages(), which resulted in me updating a bunch of
> other packages, but unfortunately left them in
> C:\WINDOWS\Temp\RtmpmtERQd\downloaded_packages, and considering my
> success so far, I'm afraid to move them or touch them.
> I was running R-2.8.0 last year when I took Jon Bakker's course
> "Analytical methods for community ecology", but upgraded this year to 2.8.1.
> Not knowing where to find a package "sp" that is >= 2.10.0, I turn to
> you for help.
>
> Thanks,
> Mike
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list