# \donttest{
if (mlr3misc::require_namespaces(c("CAST", "sf"), quietly = TRUE)) {
library(mlr3)
library(mlr3spatiotempcv)
task = tsk("ecuador")
points = sf::st_as_sf(task$coordinates(), crs = task$crs, coords = c("x", "y"))
modeldomain = sf::st_as_sfc(sf::st_bbox(points))
resampling = rsmp("spcv_knndm",
folds = 5, modeldomain = modeldomain)
resampling$instantiate(task)
autoplot(resampling, task,
fold_id = 1, size = 0.7) *
ggplot2::scale_x_continuous(breaks = seq(-79.085, -79.055, 0.01))
}
# }
Run the code above in your browser using DataLab