blockCV: Spatial and Environmental Blocking for Cross-Validation
Creates spatially or environmentally separated, or
group-preserving, training and testing folds for k-fold,
leave-group-out, and leave-one-out cross-validation. Provides spatial
blocking, clustering, buffering, and nearest-neighbour distance-matching
methods, together with tools to visualise folds, summarise fold sizes and class balance,
and assess train–test separation and environmental novelty. Also estimates spatial
autocorrelation ranges in point samples and continuous raster covariates
to provide an initial distance scale for designing spatial folds. Methods
are described in Valavi, R. et al. (2019)
<doi:10.1111/2041-210X.13107>.
| Version: |
4.0-0 |
| Depends: |
R (≥ 3.6.0) |
| Imports: |
sf (≥ 1.0), terra (≥ 1.6-41), ggplot2 (≥ 3.3.6), cowplot, automap (≥ 1.1-20), Rcpp (≥ 1.0.2) |
| LinkingTo: |
Rcpp |
| Suggests: |
shiny (≥ 1.7), tmap (≥ 2.0), biomod2, gstat, methods, knitr, rmarkdown, testthat (≥ 3.0.0) |
| Published: |
2026-08-20 |
| DOI: |
10.32614/CRAN.package.blockCV |
| Author: |
Roozbeh Valavi
[aut, cre],
Jane Elith [aut],
José Lahoz-Monfort [aut],
Ian Flint [aut],
Gurutzeta Guillera-Arroita [aut] |
| Maintainer: |
Roozbeh Valavi <valavi.r at gmail.com> |
| BugReports: |
https://github.com/rvalavi/blockCV/issues |
| License: |
GPL (≥ 3) |
| URL: |
https://github.com/rvalavi/blockCV |
| NeedsCompilation: |
yes |
| Citation: |
blockCV citation info |
| Materials: |
README, NEWS |
| In views: |
Spatial |
| CRAN checks: |
blockCV results |
Documentation:
Downloads:
Reverse dependencies:
| Reverse imports: |
CompositionalSR, glossa, intSDM, PointedSDMs |
| Reverse suggests: |
BiodiversityR, caretSDM, confcons, ENMeval, forestecology, mlr3spatiotempcv, spboost, tidysdm |
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=blockCV
to link to this page.