Class "RFspatialGridDataFrame"
Class for spatial attributes that have spatial or
spatio-temporal locations (at least of dimension 2)
on a (full) regular grid. Direct extension of class
SpatialGridDataFrame
from the sp-package. See
sp2RF
for an explicit
transformation.
## S4 method for signature 'RFspatialGridDataFrame' RFspDataFrame2conventional(obj, data.frame=FALSE)
obj |
an |
data.frame |
logical. If |
Objects can be created by using the functions
RFspatialGridDataFrame
or
conventional2RFspDataFrame
or by calls of the form
as(x, "RFspatialGridDataFrame")
, where x
is of class
RFspatialGridDataFrame
.
.RFparams
:list of 2; .RFparams$n
is the number
of repetitions of the random field contained in the data
slot;
.RFparams$vdim
gives the dimension of the values of the random
field, equals 1 in most cases
data
:object of class data.frame
;
containing attribute data
grid
:object of class
GridTopology
; grid
parameters
bbox
:matrix specifying the bounding box
proj4string
:object of class CRS
;
projection
Class "SpatialGridDataFrame"
, directly.
Class "SpatialGrid"
, by class "SpatialGridDataFrame"
.
Class "Spatial"
, by class "SpatialGrid"
.
signature(obj =
"RFspatialGridDataFrame")
:
generates contour
plots
signature(obj =
"RFspatialGridDataFrame")
: generates nice image
plots
of the random field; if space-time-dim2, a two-dimensional
subspace can be selected using the argument
MARGIN
; to get different slices in a third direction, the
argument MARGIN.slices
can be used;
for more details see plot-method
or type
method?plot("RFspatialGridDataFrame")
signature(obj =
"RFspatialGridDataFrame")
: generates persp
plots
signature(x = "RFspatialGridDataFrame")
:
uses the show
-method for class
SpatialGridDataFrame
.
signature(x = "RFspatialGridDataFrame")
:
identical to show
-method
signature(obj =
"RFspatialGridDataFrame")
: conversion to a list of
non-sp-package based objects; the data
-slot
is converted to an array of dimension [1*(vdim>1) +
space-time-dimension + 1*(n>1)]; the grid
-slot is
converted to a 3-row matrix; the grid definition of a possible
time-dimension becomes a separate list element
signature(obj =
"RFspatialGridDataFrame")
: conversion of the data
-slot
to an array of dimension [space-time-dimension + 2], where the
space-time-dimensions run fastest, and vdim and n are
the last two dimensions
signature(x = "RFspatialGridDataFrame")
:
calculates the coordinates from grid definition
signature(x = "RFspatialGridDataFrame")
: selects
columns of data
-slot; returns an
object of class RFspatialGridDataFrame
.
signature(x = "RFspatialGridDataFrame")
: replaces
columns of data
-slot; returns an
object of class RFspatialGridDataFrame
.
signature(x = "RFspatialGridDataFrame")
:
converts into other formats, only implemented for target class
RFspatialPointsDataFrame
signature(...)
: if arguments have identical
topology, combine their attribute values
signature(x = "RFspatialGridDataFrame")
: returns the range
signature(x = "RFspatialGridDataFrame")
: plots histogram
signature(x = "RFspatialGridDataFrame")
:
converts data
-slot to matrix
signature(x = "RFspatialGridDataFrame")
:
converts data
-slot to array
signature(x = "RFspatialGridDataFrame")
:
converts data
-slot to vector
signature(x = "RFspatialGridDataFrame")
:
converts data
-slot and coordinates to a data.frame
Note that in the data
-slot, each column is ordered according to the
ordering of coordinates(grid)
, the first dimension runs fastest
and for all BUT the second dimension, coordinate values are in
ascending order. In the second dimension, coordinate values run from
high to low. Hence, when converting to conventional formats using
RFspDataFrame2conventional
or RFspDataFrame2dataArray
,
the data array is re-ordered such that all dimensions are in ascending
order. as.matrix
does not perform re-ordering.
Methods summary
,
and dimensions
are defined for the “parent”-class
RFsp
.
Alexander Malinowski, Martin Schlather, schlather@math.uni-mannheim.de, https://www.wim.uni-mannheim.de/schlather/
RFspatialPointsDataFrame-class
, which is for point
locations that are not on a grid,
RFgridDataFrame-class
which is for one-dimensional
locations,
RFsp
,
sp2RF
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set ## RFoptions(seed=NA) to make them all random again n <- 3 x <- GridTopology(cellcentre.offset=c(0, 0), cellsize=c(1, 0.2), cells.dim=c(10, 30)) f <- RFsimulate(model=RMexp(), x=x, n=n) str(f) str(RFspDataFrame2conventional(f)) str(RFspDataFrame2dataArray(f)) head(coordinates(f)) str(f[2]) ## selects second column of data-slot all.equal(f, cbind(f,f)[1:3]) ## TRUE str(as(f, "RFspatialPointsDataFrame")) plot(f, nmax=2) steps <- c(10, 1, 10, 10) x2 <- rbind(c(0, 0, 0, 0), c(1, 0.2, 2, 5), steps) scale <- 10 f2 <- RFsimulate(model=RMwhittle(nu=1.2, scale=scale), x=x2, n=n, grid = TRUE) plot(f2, MARGIN=c(3,4), MARGIN.slices=1, n.slices=6, nmax=2) f.sp <- RFsimulate(model=RMexp(), x=x, n=n) f.old <- RFsimulate(model=RMexp(), x=x, n=n, spConform=FALSE) all.equal(RFspDataFrame2conventional(f.sp)$data, f.old, check.attributes=FALSE) ## TRUE
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.