SpatialIndexDataFrame: Class "SpatialIndexDataFrame"

Description Objects from the Class Slots Methods Author(s) See Also Examples

View source: R/SpatialIndexDataFrame-class.R

Description

This class is an extension of the data.frame class. In addition it has an index vector of arbitrary length, consisting of integers that assign the rows of the data to the positions in the index. The class is needed to complete the SpatialDataFrame-class in cases where no spatial information is available.

Objects from the Class

Objects can be created by calls of the form as(x,"SpatialIndexDataFrame"), from x of class data.fame, or from scratch with SpatialIndexDataFrame(index, data.frame).

Slots

data:

Object of class data.frame.

index:

Object of class integer; it must consist of the values 1:nrow(data) and may contain NA. The length is arbitrary.

bbox:

Object of class matrix; no values (only needed to fit the structure of SpatialDataFrame).

proj4string:

Object of class CRS; no values (only needed to fit the structure of SpatialDataFrame).

Methods

coordinates

Returns NULL, only needed to fit the structure of the SpatialDataFrame class.

proj4string

Returns NA, only needed to fit the structure ofthe SpatialDataFrame class.

bbox

Returns matrix of 0s, only needed to fit the structure ofthe SpatialDataFrame class.

spplot

Turns index into a column (top to bottom) of grid cells with the respective values and plots it by spplot. Layout parameters like colours may be forwarded to spplot.

cbind

Method to combine values of SpatialIndexDataFrame objects with identical index.

rbind

Method to combine SpatialIndexDataFrame objects with data of identical type and name.

subsetSDF

See subsetSDF.SpatialIndexDataFrame. There is no "[" function for this class.

areaSDF

See areaSDF, returns vector of 0s, needed to fit the structure of the SpatialIndexDataFrame class.

length

signature(x = "SpatialIndexDataFrame"): number of elements, i.e. of groups of cells with respectively share the attributes.

Author(s)

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

See Also

SpatialDataFrame-class, which is a wrapper.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# generate SpatialIndexDataFrame from scratch
index = c(2,2,1,1,1,1,3,2,3,3,3,1)
SIndexDF1 = SpatialIndexDataFrame(index = as.integer(index), 
                          data = data.frame(a = c(1,2,4), 
                                            b = c(0.1, 0.2, 0.3), 
                                            c = c("A", "B", "A")))
# generate from data.frame
data(USArrests)
SIndexDF2 = as(USArrests,"SpatialIndexDataFrame")


# spplot
spplot(SIndexDF1, zcol = c("b", "c"), col.regions = grey.colors(10))

# cbind
SIndexDF3 = cbind(SIndexDF1, SIndexDF1)

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