xy_sample_regular: Place a regular sampling grid over a polygon of arbitrary...

Description Usage Arguments Details Value

View source: R/sampling_design.R

Description

Place a regular sampling grid over a polygon of arbitrary shape

Usage

1
xy_sample_regular(sp_poly, n, M = 1, cell_size = NULL, random_rot = TRUE)

Arguments

sp_poly

An object of class SpatialPolygons from the sp package.

n

Sample size

M

Number of independent samples of size n

cell_size

If missing, a cell size is derived from the sample size n; otherwise the cell size is used to calculate the grid spacing (assuming a square grid).

random_rot

Logical, if TRUE the grid is rotated randomly

Details

Due to the systematic nature of the generated samples, sample size is not constant but will on average reach the expected sample size n.

Grids are generated with a random starting point choosen from an area in the lower left corner of the polygon's bounding box. The size of this area corresponds to the cell size of the grid as set by cell_size or as inferred from n if cell_size is NULL.

Sample grids are initially generated for the entire bounding box that encompasses sp_poly, and are refined to the actual outline of the study region in a second step. If M becomes large (say > 10000), the computation of the M samples will take while.

Value

A data.table object with approximately M times n rows holding an identifier and xy-coordinates.


AWF-GAUG/fisim documentation built on May 28, 2019, 11:02 a.m.