hexgrid: Produces the nodes of an equidistant grid.

Description Usage Arguments Details Value Author(s) References See Also Examples

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

1
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

See Also

spsample

Examples

1
2
3
4
5
6
## 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)))

Example output

Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
This is simba 0.3-5

Attaching package: 'simba'

The following object is masked from 'package:stats':

    mad

--------------------------------------------------------------
 Analysis of Geostatistical Data
 For an Introduction to geoR go to http://www.leg.ufpr.br/geoR
 geoR version 1.7-5.2.1 (built on 2016-05-02) is now loaded
--------------------------------------------------------------

Warning message:
no DISPLAY variable so Tk is not available 

simba documentation built on May 1, 2019, 8:49 p.m.