subsetSDF: Subsetting objects of class SpatialDataFrame

Description Usage Arguments Value Note Author(s) Examples

View source: R/subsetSDF.R

Description

Subsetting of objects of class SpatialDataFrame: selects according to the spatial objects or to the attribute(s), and returns an object of the same class.

Usage

1
subsetSDF(x, locations, data = names(x@data), ...)            

Arguments

x

object of class SpatialDataFrame

locations

integer vector: keep object at these spatial locations

data

integer vector or names of columns of the x@data to be kept

...

further arguments to be passed to other methods

Value

An object of the same SpatialDataFrame class.

Note

This is a wrapper function for the subsetting methods in all subclasses of SpatialDataFrame, with the parameters that are common to all classes; for the general subsetting methods refer to subset.Spatial for the classes imported from package sp and to subsetSDF.SpatialIndexDataFrame and subsetSDF.SpatialPolygridDataFrame.

Author(s)

Kristina B. Helle, kristina.helle@uni-muenster.de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(SIndexDF)
data(SPointsDF)
data(SPixelsDF)
data(SPolygridDF)
data(SPolygonsDF)
data(SLinesDF)

sub_Index = subsetSDF(SIndexDF, locations = c(1,3), data = "c")
sub_Points = subsetSDF(SPointsDF, locations = c(1,3), data = "z")
sub_Pixels = subsetSDF(SPixelsDF, locations = c(1,3), data = "z")
sub_Polygrid = subsetSDF(SPolygridDF, locations = c(1,3), data = "b")
sub_Polygons = subsetSDF(SPolygonsDF, locations = c(1,3), data = "a")
sub_Lines = subsetSDF(SLinesDF, locations = 1:2, data = "a")

KristinaHelle/sensors4plumes documentation built on May 7, 2019, 12:31 p.m.