[R-sig-Geo] How to subset a spatial grid?
edzer.pebesma at uni-muenster.de
Tue May 20 10:11:04 CEST 2008
Have you tried
Map1 <- Map[1:100,1:100]
Note that this works differently for SpatialGridDataFrames and
SpatialPixelsDataFrames; the first knows about [rows,cols,bands], the
second about [pixels, bands].
Yong Li wrote:
> Dear All,
> I want to subset a large spatial grid (2000*2000) into many smaller
> grids for further processing in my simulation models. Could anyone do it
> before and any tips will be highly appreciated?
> Map <- readGDAL("yong.img") # one image from erdras imagine
> Map$va <- Map$band1
> Map$band1 <- NULL
> Map1 <- a subset of Map$va based on selected cols and rows.
> Yong Li
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
More information about the R-sig-Geo