[R-sig-Geo] selection of data subsets in spatial classes

Edzer J. Pebesma e.pebesma at geo.uu.nl
Thu Jun 8 09:30:47 CEST 2006

karl.sommer at dpi.vic.gov.au wrote:
> thanks  Roger Bivand, this is really powerful and much less cumbersome than
> I feared.
> I ran an inverse distance interpolation on some of the screened data.  In
> order to do so I created a destination file from scratch with a 2 x 2 m
> grid. The destination file is of rectangular shape and is larger than the
> field for which a I have the aerial image data which is a polygon.  As a
> result the kriging procedure extends beyond the field.
> Is there a way to either create a sampling grid that is the same shape as
> the field, ie from a shape file,  or is there a way to subtract the two
> layers such that only the field shape is retained (something similar to
> mapcalc in GRASS)?

you may want to have a look at function makegrid in sp. It's
first argument should have a bounding box (as all Spatial objects
have), or be such a bounding box.

More information about the R-sig-Geo mailing list