Description Usage Arguments Details Value
View source: R/sampling_design.R
Place a regular sampling grid over a polygon of arbitrary shape
1 | xy_sample_regular(sp_poly, n, M = 1, cell_size = NULL, random_rot = TRUE)
|
sp_poly |
An object of class |
n |
Sample size |
M |
Number of independent samples of size |
cell_size |
If missing, a cell size is derived from the sample size
|
random_rot |
Logical, if TRUE the grid is rotated randomly |
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.
A data.table
object with approximately
M
times n
rows holding an identifier and xy-coordinates.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.