[R-sig-Geo] index a SpatialGridDataFrame

Ingo Holz Ingo.Holz at uni-hohenheim.de
Thu Dec 20 08:54:02 CET 2007


Hi,

 I would like to add data to a SpatialGridDataFrame (SGDF) in a loop.

 Something like

 for (i in 1:20){
    ....
    SGDF[,,i] <- sgdf[,,1]
    }  # sgdf is a SpatialGridDataFrame which is modified in the loop

 I get the error message that it is not possible to index an object of type S4.

 Ok..., but how can I add data to a SGDF in a loop? No way?

Thanks for your help,
Ingo




More information about the R-sig-Geo mailing list