Create a spatial-aware cross-validation split for H3 data
Source:R/h3sdm_spatial_cv.R
h3sdm_spatial_cv.Rd
Generates a spatially aware data split using the spatialsample
package.
This helps avoid inflated model performance estimates due to spatial autocorrelation.
Arguments
- data
An
sf
object, typically the output ofh3sdm_data()
.- method
Character. The spatial resampling method to use:
- "block"
Use
spatial_block_cv
for block-based spatial CV.- "cluster"
Use
spatial_cluster_cv
for cluster-based spatial CV.
- v
Integer. Number of folds (default = 5).
- ...
Additional arguments passed to the underlying
spatialsample
function.