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

karl.sommer at dpi.vic.gov.au karl.sommer at dpi.vic.gov.au
Wed Jun 7 07:50:28 CEST 2006


Hello list

I have been trying to figure out if it is possible to select a subset of
data in a SpatialGridDataFrame without prior conversion to a data.frame
using the method as.data.frame().

I have imported an ESRI " *. bil " file containing different spectral bands
using rgdal.  The file imported as a SpatialGridDataFrame.  The data
originates from an aerial photograph of a row crop and I would like to
select pixels from within a row as opposed to those from the inter-row
space for further interpolation.   Inter-row pixels have a different
signature and therefore may be potentially screened out.  However, I have
been unable to access the SpatialGridDataFrame directly with, for example,
a  subset(x, band5 < lowerLimit, select c(a, b) ) call for selecting values
according to given criteria.

Am I using the wrong strategy, should I just demote the spatial class using
method as.data.frame(), do the manipulation and then promote the screened
values back to a spatial class?

Regards

Karl
_________________________________
Karl J Sommer,
Department of Primary Industries,
PO Box 905
Mildura, VIC, Australia 3502

Tel: +61 (0)3 5051 4390
Fax +61 (0)3 5051 4534

Email:     karl.sommer at dpi.vic.gov.au




More information about the R-sig-Geo mailing list