stratified_sampling_sf: Spatially stratified random sample points from an image.

View source: R/spatial_func.R

stratified_sampling_sfR Documentation

Spatially stratified random sample points from an image.

Description

Spatially stratified random sample points from an image by R package sf

Usage

stratified_sampling_sf(
  points,
  cellsize = c(600, 600),
  num_samples_per_stratum = 1
)

Arguments

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.

Value

Return a vector contains index of sampled points.

Examples


data("lung5")
pt_idx<-stratified_sampling_sf(lung5, cellsize = c(600,600))


SpaTopic documentation built on April 4, 2025, 1:38 a.m.