# \donttest{
library(blockCV)
# import presence-absence species data
points <- read.csv(system.file("extdata/", "species.csv", package = "blockCV"))
# make an sf object from data.frame
pa_data <- sf::st_as_sf(points, coords = c("x", "y"), crs = 7845)
# load raster data
path <- system.file("extdata/au/bio_5.tif", package = "blockCV")
covar <- terra::rast(path)
nndm <- cv_nndm(x = pa_data,
column = "occ", # optional
r = covar,
size = 350000, # size in metres no matter the CRS
num_sample = 10000,
sampling = "regular",
min_train = 0.1)
# }
Run the code above in your browser using DataLab