Function to calculate the number of hexagonal grids
calculate_n(x, d = NULL, area = NULL, country)
x | A class SpatialPolygons or SpatialPolygonsDataFrame object defining the area to be sampled |
---|---|
d | A numeric value for length (in kilometres) of the maximum distance of a village/community from a sampling point. |
area | A numeric value for area (in square kilometres) of a hexagon in a hexagonal grid defining the sampling spatial resolution |
country | Name of country where sampling area is located. This is used
to determine the appropriate UTM projection to transform |
A numeric value for number of hexagons to divide sampling area based
on a specified d
or a specified hexagon area
size.
# Calculate number of hexagons to create a sampling grid with a d = 10 kms # on Sennar State in Sudan sennar <- subset(sudan01, STATE == "Sennar") calculate_n(x = sennar, d = 10, country = "Sudan")#> Warning: Discarded datum Unknown based on WGS84 ellipsoid in CRS definition#> Warning: NULL source CRS comment, falling back to PROJ string#> [1] 154