powered by
Spatially stratified random sample points from an image by R package sf
sf
stratified_sampling_sf( points, cellsize = c(600, 600), num_samples_per_stratum = 1 )
Return a vector contains index of sampled points.
a data frame contains all points in a image with X, Y coordinates.
a vector of length 2 contains the size of each grid square. Default c(600,600).
number of point selected from each grid square. Default 1.
data("lung5") pt_idx<-stratified_sampling_sf(lung5, cellsize = c(600,600))
Run the code above in your browser using DataLab