calculate_n: Function to calculate the number of hexagonal grids

Description Usage Arguments Value Examples

View source: R/calculate_n.R

Description

Function to calculate the number of hexagonal grids

Usage

1
calculate_n(x, d = NULL, area = NULL, country)

Arguments

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 x

Value

A numeric value for number of hexagons to divide sampling area based on a specified d or a specified hexagon area size.

Examples

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

validmeasures/spatialsampler documentation built on Oct. 16, 2021, 3:15 a.m.