Learn R Programming

sensors4plumes (version 0.9.3)

subsetSDF.SpatialIndexDataFrame: Subsetting objects of class SpatialIndexDataFrame

Description

Subsetting of objects of class SpatialIndexDataFrame: selects index and/or attribute(s), and returns an object of class SpatialIndexDataFrame.

Usage

subsetSDF.SpatialIndexDataFrame(x, locations, data = names(x@data), ..., grid)

Arguments

x

object of class SpatialIndexDataFrame

locations

integer vector: keep data where x@index has this value (multiplicity ignored, order taken into account)

data

integer vector or names of columns of the x@data to be kept (order and multiplicity ignored)

...

further arguments to be passed to other methods

grid

integer vector: indices of x@index, keep the corresponding data

Value

A SpatialIndexDataFrame; the subsetting can be done cumulatively, e.g. if grid and locations is given, only the index entries that fullfill both criteria are kept.

Examples

Run this code
# NOT RUN {
data(SIndexDF)
# subset
SIndexDF1 = subsetSDF(SIndexDF, grid = which(SIndexDF@index == 1)) 
SIndexDF2 = subsetSDF(SIndexDF, locations = 1) # identical to x_1
SIndexDF3 = subsetSDF(SIndexDF, grid = c(2:4, 6:8, 10:12, 14:16, 18:20), data = "c")
# }

Run the code above in your browser using DataLab