randGrid: Random drawing of a 'Grid' object

View source: R/GridData.R

randGridR Documentation

Random drawing of a Grid object

Description

Random drawing of a Grid object

Usage

randGrid(
  dim = 1L + rpois(1L, lambda = 3),
  nxMin = 1L,
  nxE = 4L,
  nlevels,
  dimNames
)

Arguments

dim

The spatial dimension.

nxMin

Minimum number of nodes. Integer vector of length 1 or dim.example(Grid).

nxE

Expected number of nodes. Numeric vector of length 1 or dim.

nlevels

Integer vector giving the number of levels for each spatial dimension.

dimNames

Names of the spatial dimensions.

Details

The nodes are drawn by first choosing their number for each spatial dimension using a Poisson distribution, and then by drawing a sample of the uniform distribution with the suitable size.

Value

An object with S4 class "Grid".

Note

This function is not not for drawing random design points from within the object.

Author(s)

Yves Deville

See Also

Grid-class.

Examples

set.seed(1234)
## specify dim: number of levels are random!
GD <- randGrid(dim = 4)
plot(GD)
## specify number of levels (hence dim)
GD2 <- randGrid(nlevels = c(2, 3, 4))
plot(GD2)


IRSN/smint documentation built on Dec. 9, 2023, 9:53 p.m.