Skip to content

converting old sp objects

3 messages · Duncan Golicher, Roger Bivand

#
I have quite a number of SpatialGridDataFrame objects that were saved 
internally under R 2.3.0 and sp0.8-16.  Can anyone suggest a quick and 
easy way to convert them for use with R2.4.0 and sp0.9-2. (I do have 
ways, but they are all a bit longwinded).

Thanks,

Duncan
#
On Fri, 27 Oct 2006, Duncan Golicher wrote:

            
The issue was announced on this list on 28 September:

https://stat.ethz.ch/pipermail/r-sig-geo/2006-September/001354.html

and has been on the Rgeo site since about the same time.

The major issue is that the way new-style classes (and objects belonging 
to those classes) are defined internally, so the internal (*.RData) 
representations are not compatible.

To transfer from the old internal form, use R < 2.4.0, and sp < 0.9 to for 
example export column by column to GRASS, and then read back in in R >= 
2.4.0 and sp >= 0.9. Alternatively for non-GRASS users, rgdal and the 
GTiff fotmat could be used (and should work with multiple bands). The 
writeAsciiGrid() function in maptools could also be used. There is no way 
of upgrading the serialised object from the *.RData form directly. 

We know that this is an unfortunate incompatibility, but the changes in 
the methods package are being made to improve class/object handling, 
making the software faster and more robust, so the difficulties are 
unavoidable. For critical projects already using R < 2.4.0, I suggest only 
upgrading when sensible.

Roger

  
    
#
Thanks. No problem, I use GRASS and was converting them using rgrass6. I 
just hoped there was an even simpler way. I had missed the posting on 
the change, but realised more or less what was going on a few days ago 
when I upgraded.

Duncan
Roger Bivand wrote: