Description Objects from the Class Slots Methods Examples
S4 class
Objects can be created by calls of the form new("Grid",
...)
. or more simply by calling Grid
.
dim
:Object of class "integer"
Spatial dimension or number of
inputs.
dimNames
:Object of class "character"
Names of the spatial dimensions
or inputs.
levels
:Object of class "list"
List with length dim
containing the levels, i.e. the distinct values taken by
the corresponding spatial variable.
index
:Object of class "array"
Integer index of the combination
of levels.
signature(a = "Grid")
: generalized transposition
signature(x = "Grid")
: coercion to a data frame, with
one row for each combination of the levels.
signature(x = "Grid")
: coercion to a matrix, with one
row by combination of the levels.
signature(X = "Grid")
: check desing.
signature(X = "Grid")
: find closest points.
signature(x = "Grid")
: spatial dimension d.
signature(x = "Grid")
: names of the spatial dimensions.
signature(x = "Grid", value = ANY)
: replace the names of the spatial
dimensions.
signature(x = "Grid")
: number of grid nodes.
signature(x = "Grid")
: extracts the list of the levels,
i.e. the possible distinct values for each spatial dimension.
signature(x = "Grid")
: vector of number of levels, one
value for each spatial dimension.
signature(x = "Grid")
: plot an object using
pairs
.
signature(x = "Grid")
: draw random nodes.
signature(x = "Grid")
: show grid properties.
1 2 3 4 5 6 7 8 9 10 11 12 13 | showClass("Grid")
## generate a random Grid object, and change its order for tests
set.seed(1234)
GD <- randGrid(nlevels = c("X" = 2, "Y" = 3))
n <- length(GD@index)
ind <- sample(n, size = n, replace = FALSE)
GD@index <- array(ind, dim = nlevels(GD))
X2 <- as.matrix(GD)
GD2 <- as.Grid(X2)
X2Bis <- as.matrix(GD2)
## This hould be zero!
max(abs(X2 - X2Bis))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.