Defines a full regular (spatial) grid. Constructor function of the grid.par-class.

grid.par(
  n,
  min,
  max = min + (n - 1) * lag,
  lag = (max - min)/(n - 1),
  dimnames = names(min)
)

Arguments

n

integer vector; number of nodes in each dimension.

min

vector; minimum values of the coordinates.

max

vector; maximum values of the coordinates (optional).

lag

vector; lag in each dimension (optional).

dimnames

character vector; names used to label the dimensions.

Value

Returns an object of class grid.par, a list with the arguments as components and an additional component $nd = length(n).

Details

All parameters must have the same length. Only one of the arguments max or lag must be specified.

S3 'version' of the GridTopology-class of the sp package.

See also

Examples

grid.par(n = c(100, 100), min = c(-10, 42), max = c(-7.5, 44))
#>      n min  max        lag
#> x1 100 -10 -7.5 0.02525253
#> x2 100  42 44.0 0.02020202
grid.par(n = c(100, 100), min = c(-10, 42), lag = c(0.03, 0.02))
#>      n min   max  lag
#> x1 100 -10 -7.03 0.03
#> x2 100  42 43.98 0.02