sample_ct | R Documentation |
Sample potential camera trap locations. For stratified sampling, provide a
suitable column to stratify region by. Alternatively, sf::st_sample()
is used directly to sample points across all features.
sample_ct(region, n, type, strata = NULL)
region |
spatial feature object across which points will be sampled |
n |
number of random points. If |
type |
type of sampling, see |
strata |
column name in region indicating strata |
sf
(see sf::st_sf()
) object with POINT geometry
# Example grid with density levels (High, Medium, Low)
data(clearwater_lake_density)
# Stratified random points for each density level
pts_random <- sample_ct(
region = clearwater_lake_density, n = 20,
type = 'random', strata = 'density')
# Plot density grid and sampled points
plot(clearwater_lake_density, reset = FALSE)
plot(pts_random, add = TRUE, pch = 1, strata = 1)
# Regular sampled points across all features
pts_regular <- sample_ct(
region = clearwater_lake_density, n = 20, type = 'regular')
# Plot density grid and sampled points
plot(clearwater_lake_density, reset = FALSE)
plot(pts_regular, add = TRUE, pch = 2, strata = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.