makegrid {gstat}R Documentation

make regular grid with square cells and round numbers

Description

make regular grid with square cells and round numbers

Usage

makegrid(x, y, n=10000, nsig=2, margin=1.05, cell.size)

Arguments

x x-coordinate
y y-coordinate
n approximate number of cells in grid
nsig number of significant digits to which cell size and origin are rounded
margin margin around the x and y coordinate limits
cell.size cell size; if missing, a reasonable, and rounded, estimate is made

Value

data frame with the following elements:

x x-coordinates
y y-coordinate

Note

see also spsample methods in package sp; the better code is there

Examples

data(meuse)
grd <- makegrid(meuse$x, meuse$y, 1000)
diff(grd$x)
diff(grd$y)
summary(grd)
grd <- makegrid(meuse$x, meuse$y, cell.size = 40)
diff(grd$x)
diff(grd$y)
summary(grd)

[Package gstat version 0.9-22 Index]