Learn R Programming

RandomFields (version 3.1.16)

RFgridDataFrame-class: Class RFgridDataFrame

Description

Class for attributes in one-dimensional space.

Usage

"RFspDataFrame2conventional"(obj, data.frame=FALSE)

Arguments

obj
an RFgridDataFrame object
data.frame
logical. If TRUE a data.frame is returned.

Creating Objects

Objects can be created by using the functions RFgridDataFrame or conventional2RFspDataFrame or by calls of the form as(x, "RFgridDataFrame"), where x is of class RFgridDataFrame.

Slots

.RFparams:
list of up to 5 elements;
  • n is the number of repetitions of the random field contained in the data slot
  • vdim gives the dimension of the values of the random field, equals 1 in most cases
  • has.variance indicates whether information on the variance is available,
  • coordunits gives the names of the units for the coordinates
  • varunits gives the names of the units for the variables
data:
object of class data.frame, containing attribute data
grid:
object of class GridTopology.

Methods

plot
signature(obj = "RFgridDataFrame"): generates nice 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("RFgridDataFrame")
show
signature(x = "RFgridDataFrame"): uses the show-method for class SpatialGridDataFrame.
print
signature(x = "RFgridDataFrame"): identical to show-method
RFspDataFrame2conventional
signature(obj = "RFgridDataFrame"): 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)]$
coordinates
signature(x = "RFgridDataFrame"): returns the coordinates
[
signature(x = "RFgridDataFrame"): selects columns of data-slot; returns an object of class RFgridDataFrame.
[<-
signature(x = "RFgridDataFrame"): replaces columns of data-slot; returns an object of class RFgridDataFrame.
as
signature(x = "RFgridDataFrame"): converts into other formats, only implemented for target class RFpointsDataFrame
cbind
signature(...): if arguments have identical topology, combine their attribute values
range
signature(x = "RFgridDataFrame"): returns the range
hist
signature(x = "RFgridDataFrame"): plots histogram
as.matrix
signature(x = "RFgridDataFrame"): converts data-slot to matrix
as.array
signature(x = "RFgridDataFrame"): converts data-slot to array
as.vector
signature(x = "RFgridDataFrame"): converts data-slot to vector
as.data.frame
signature(x = "RFgridDataFrame"): converts data-slot and coordinates to a data.frame

Details

Methods summary and dimensions are defined for the “parent”-class RFsp.

See Also

RFspatialGridDataFrame, which is for point locations in higher dimensional spaces, RFpointsDataFrame-class which is for one-dimensional arbitray locations, RFsp

Examples

Run this code
RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
##                   RFoptions(seed=NA) to make them all random again

x <- seq(0,10,length=100)
f <- RFsimulate(model=RMgauss(), x=x, n=3)

str(f)
str(RFspDataFrame2conventional(f))
head(coordinates(f))
str(f[2]) ## selects second column of data-slot
all.equal(f, cbind(f,f)[1:3]) ## TRUE

plot(f, nmax=2)


Run the code above in your browser using DataLab