SpatialDataFrame-class: Class "SpatialDataFrame"

Description Usage Arguments Objects from the Class Methods Author(s) Examples

Description

Class for a data frame with associated spatial attributes (points, lines, polygons, (irregular) grid).

Usage

1

Arguments

SpatialDataFrame

an object, if its class belongs to one of the subclasses of SpatialDataFrame-class the function returns TRUE else FALSE

Objects from the Class

This class is a wrapper for some classes from package sp:

SpatialPointsDataFrame-class,

SpatialPixelsDataFrame-class,

SpatialPolygonsDataFrame-class,

SpatialLinesDataFrame-class

Besides it contains two classes specific to sensors4plumes:

SpatialIndexDataFrame-class: Objects of this class have no spatial reference, they are just data.frames with an extra index.

SpatialPolygridDataFrame: These objects are similar to those from SpatialGridDataFrame-class, but several grid cells may refer to the same attributes in the data frame.

Methods

The following methods exist for all objects of class SpatialDataFrame. They may be defined individually for the respective subclasses, refer to the subclasses for details.

is.SpatialDataFrame

TRUE for objects of class SpatialDataFrame, else FALSE

length

signature(x = "SpatialDataFrame"): length (number of spatial elements)

coordinates

signature(x = "SpatialDataFrame"): retrieves coordinates (of centroids)

proj4string

signature(x = "SpatialDataFrame"): retrieves the projection as CRS-class

bbox

signature(x = "SpatialDataFrame"): retrieves the bounding box

spplot

signature(x = "SpatialDataFrame", zcol = "integer", ...): plots maps of the attributes zcol ("integer" or names of x@data); wrapper of spplot

subsetSDF

signature(x = "SpatialDataFrame", locations = "integer", data = "integer"): selects spatial sub-objects (locations) and/or attributes (data: "integer" or "character" names of x@data), returns an object of the same class. This is a general method for all SpatialDataFrame objects. There are special subset or "[" functions for the subclasses that may have more possibilities to choose (e.g. subset grid by a bounding box), see the subclasses for details.

areaSDF

signature(x = "SpatialDataFrame"): computes the area/length of the elements (grid cells, polygons...), for point data it returns 0s.

Refer to the subclasses for further methods.

Author(s)

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# generate a SpatialPixelsDataFrame
data(meuse.grid)
gridded(meuse.grid) = ~ x + y

# extract some locations and attibutes
meuse.subgrid = subsetSDF(meuse.grid, 
        locations = c(1:45), 
        data = c("dist", "soil", "ffreq"))

# plot
spplot(meuse.subgrid, zcol = 1:2)

sensors4plumes documentation built on May 1, 2019, 10:27 p.m.