Learn R Programming

gstat (version 0.9-22)

makegrid: 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:
  • xx-coordinates
  • yy-coordinate

Examples

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

Run the code above in your browser using DataLab