stratified_sampling_sf | R Documentation |
Spatially stratified random sample points from an image by R package sf
stratified_sampling_sf(
points,
cellsize = c(600, 600),
num_samples_per_stratum = 1
)
points |
a data frame contains all points in a image with X, Y coordinates. |
cellsize |
a vector of length 2 contains the size of each grid square. Default c(600,600). |
num_samples_per_stratum |
number of point selected from each grid square. Default 1. |
Return a vector contains index of sampled points.
data("lung5")
pt_idx<-stratified_sampling_sf(lung5, cellsize = c(600,600))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.