Learn R Programming

smint (version 0.4.0)

Grid-class: Class "Grid"

Description

S4 class

Arguments

Objects from the Class

Objects can be created by calls of the form new("Grid", ...). or more simply by calling Grid.

Examples

Run this code
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))

Run the code above in your browser using DataLab