hexgrid {simba}R Documentation

Produces the nodes of an equidistant grid.

Description

Given the coordinates of a starting point (left upper point of the grid), the function produces the nodes of an equidistant grid. Extent and distance between plots can be specified.

Usage

hexgrid(x, y, r = 100, nro = 10, nco = 20)

Arguments

x x-value of the starting point. Defaults to 0.
y y-value of the starting point. Defaults to 0.
r Distance between nodes. Defaults to 100.
nro Number of rows in the grid. Defaults to 10
nco Number of columns in the grid. Defaults to 20. They are doubled (see the grid) compared to the rows. That's why 2*nro produces a quadratic grid.

Details

If the overall shape of the grid is not square, the user has to delete by hand the superfluous units. Might get more flexible in future versions.

Value

Returns a data.frame giving informations on the produced point/unit/plot locations with the following columns:

ROW Number of row in the grid to which the point/unit/plot belongs.
COL Number of column in the grid to which the point/unit/plot belongs.
X x-coordinate of the point.
Y y-coordinate of the point.

Author(s)

Gerald Jurasinski

References

http://homepage.mac.com/terhorab/gerald/downloads/whyhexaagons.pdf

Examples

## produces a grid with r=400:    
test.grd <- hexgrid(456000, 7356700, r=400)
## for plotting the following is recommended as it preserves 
## real positions:
library(geoR)
points.geodata(coords=test.grd[,3:4], data=rnorm(nrow(test.grd)))

[Package simba version 0.2-5 Index]