Skip to contents

Selects sampling sites stratified by land cover class `lc`, scaling sample sizes proportionally while guaranteeing a minimum sample size per class. Optional normalization is applied prior to clustering.

Usage

site_selction(
  df,
  tot.sample.size,
  min.sample.size = 50,
  normalize = TRUE,
  max.cluster.num = 6,
  elbow.operation = TRUE
)

Arguments

df

Data frame or matrix containing feature columns, a land cover column `lc`, and a weight column `weights`, where each row is a sample and each column is a feature.

tot.sample.size

Integer. Total target number of sample points to select across all land cover classes.

min.sample.size

Integer. Minimum number of sample points allocated to each land cover class. (Default = 50).

normalize

Logical. Whether to apply min-max scaling to numeric columns in `df`. (Default = TRUE).

max.cluster.num

Integer. Maximum number of clusters to consider if calculating optimal cluster count. (Default = 6).

elbow.operation

Logical. Whether to automatically calculate the proper cluster number based on the elbow location. (Default = TRUE). If FALSE, the `max.cluster.num` will be used directly as the cluster size.

Value

A list of cluster allocations and sample indices grouped by land cover class.