Description Usage Arguments Details Value Examples
View source: R/class_definitions.R
The function sample_loc
creates sample location objects, named lists
holding coordinates of sample locations spread over some area and
accompanying information about how the samples were generated.
1 | sample_loc(data, n, M, method)
|
data |
A |
n |
Sample size |
M |
Number of repeated samples |
method |
Were the points spread out randomly or regular |
Before object initialization, a couple of checks are performed, e.g., column names, data types, data consitency, etc.
In case random sampling was performed, each sample in data
should
have exactly n
sample locations. If systematic sampling was applied,
sample size varies from sample to sample depending on the shape of the
study region and sample size. If the expected sample size (n
)
provided by the user, deviates by more than 1 from the average sample size
inferred from data
, a warning is thrown rather than an error.
The prefered way for creating objects of type sample_loc is via the
xy_sample
function.
An object of class sample_loc
. A named list with the following
four entries:
$data
A data.table
object containing two identifier columns and two columns for storing
coordinates
$n
Sample size
$M
Number of repeated
samples
$method
Random or regular placement of sample
locations
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.