K-means based spatial sampling

sample_kmeans(
  coordinates,
  n_target,
  min_cells_per_region,
  balance_regions,
  verbose = TRUE
)

Arguments

coordinates

Spatial coordinates

n_target

Number of targets

min_cells_per_region

Minimum cells per region

balance_regions

Balance regions

verbose

Whether to report progress with message()

Value

Integer vector of the selected cell indices.