[R-sig-Geo] facing the bad move: how to retrieve old (sp) data after an upgrade...?

Roger Bivand Roger.Bivand at nhh.no
Wed Feb 7 15:32:24 CET 2007


On Wed, 7 Feb 2007, Horacio Samaniego wrote:

> I first need to apologize as I  have made a mistake, I know that I  
> should have read the Breaking News before (http://www.sal.uiuc.edu/ 
> tools/tools-sum/rgeo/r-spatial-projects)
> 
> Now I am trying to step back so that I can retrieve my data. However,  
> I don't seem to find old versions of the sp and spdep I need 0.8* of  
> sp as I have messed up my objects 'big time'  by upgrading the whole  
> installation.
> 
> The question is this:
> 
> - What is the best method to make up this error? (I'm hoping that I  
> am not the only one...)
> or
> - Is re-installing old versions of the packages the only method?

Yes, R >= 2.4.0 use a different internal representation for new-style 
class objects.

> 
> - Where can I find the repository for old packages?
> 

If Windows, R itself is at:

http://cran.r-project.org/bin/windows/base/old/2.3.1/R-2.3.1-win32.exe

and sp at:

http://cran.r-project.org/bin/windows/contrib/2.3/sp_0.8-20.zip
(but install.packages("sp") in R 2.3.1 will choose that version)

Otherwise:

http://cran.r-project.org/src/base/R-2/R-2.3.1.tar.gz

http://cran.r-project.org/src/contrib/Archive/S/sp_0.8-20.tar.gz

as the most recent sp < 0.9 - use R CMD INSTALL sp_0.8-20.tar.gz from the 
command line for the old R engine. 

In either case install the old R engine somewhere locally, so that it will 
not damage your new installation, the same with sp. If need be, on some 
other machine.

Hope this helps,

Roger

> thanks in advance! Any hint is appreciated
> 
> The errors I get are not apparent at first sight... but I later tried  
> to retrieve a column of the @data in a SpatialPointsDataFrame object  
> and just got >NULL
> 
> here's the sequence:
> 
>  > pija.scoressp at data[,1]
> Error in pija.scoressp at data[, 1] : incorrect number of dimensions
>  > pija.scoressp at data$PC1
> NULL
>  > names(pija.scoressp at data)
> NULL
> 
> However I can see the data with str():
>  > str(pija.scoressp)
> list()
> - attr(*, "bbox")= num [1:2, 1:2] 1032800  333100 1211500  474500
>    ..- attr(*, "dimnames")=List of 2
>    .. ..$ : chr [1:2] "slongitude" "slatitude"
>    .. ..$ : chr [1:2] "min" "max"
> - attr(*, "proj4string")= list()
>    ..- attr(*, "projargs")= chr "+proj=aea +lat_0=23.0000000000  
> +lat_1=29.5000000000 +lat_2=45.5000000000 +lon_0=-96.0000000000  
> +x_0=0.0000000000 +y_0=0.0000000"| __truncated__
>    ..- attr(*, "class")= atomic [1:1] CRS
>    .. ..- attr(*, "package")= chr "sp"
> - attr(*, "coords")= num [1:111, 1:2] 1131900 1120300 1092600 1114200  
> 1092600 ...
>    ..- attr(*, "dimnames")=List of 2
>    .. ..$ : NULL
>    .. ..$ : chr [1:2] "slongitude" "slatitude"
> - attr(*, "data")= list()
>    ..- attr(*, "att")=List of 37
>    .. ..$ PC1 : num [1:111]   -8.10 -191.88   -9.30  -28.90   -8.12 ...
>    .. ..$ PC2 : num [1:111] -25.05 316.29  -9.20 -20.25  -8.59 ...
>    .. ..$ PC3 : num [1:111]  -17.470 -104.794    0.333   48.261    
> -0.136 ...
>    .. ..$ PC4 : num [1:111]  -7.1660 -99.8927  -0.0452   3.9708   
> -4.5581 ...
>    .. ..$ PC5 : num [1:111]  24.83 210.48  -6.93   3.92 -12.88 ...
>    .. ..$ PC6 : num [1:111]   4.80 -19.21   2.76 -87.98   7.33 ...
>    .. ..$ PC7 : num [1:111] -19.88  -2.51  -2.57 -69.88  -4.70 ...
>    .. ..$ PC8 : num [1:111]   4.42  29.52   3.81 -21.48  12.54 ...
> 
> ........
> 
> 
> 
> 
> 
> Horacio
> 
> 
> 
> 	[[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