Ingo Holz wrote: > 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 > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > Hi Inge,
It can be done by something like: SGDF[[i]] = sgdf[[1]] cheers, Paul -- Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +31302535773 Fax: +31302531145 http://intamap.geo.uu.nl/~paul _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo