hexgrid {simba} | R Documentation |
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.
hexgrid(x, y, r = 100, nro = 10, nco = 20)
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. |
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.
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. |
Gerald Jurasinski
http://homepage.mac.com/terhorab/gerald/downloads/whyhexaagons.pdf
## 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)))