Description Objects from the Class Slots Methods Author(s) See Also Examples
View source: R/SpatialIndexDataFrame-class.R
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 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)
.
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
).
Returns NULL
, only needed to fit the structure of the SpatialDataFrame
class.
Returns NA
, only needed to fit the structure ofthe SpatialDataFrame
class.
Returns matrix of 0s, only needed to fit the structure ofthe SpatialDataFrame
class.
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.
Method to combine values of SpatialIndexDataFrame
objects with identical index
.
Method to combine SpatialIndexDataFrame
objects with data
of identical type and name.
See subsetSDF.SpatialIndexDataFrame. There is no "["
function for this class.
See areaSDF, returns vector of 0s, needed to fit the structure of the SpatialIndexDataFrame
class.
signature(x = "SpatialIndexDataFrame")
:
number of elements, i.e. of groups of cells with respectively share the attributes.
Kristina B. Helle, kristina.helle@uni-muenster.de
SpatialDataFrame-class
, which is a wrapper.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.