pts_file <- system.file(
"extdata/points/synthetic_occurrence_points.csv",
package = "TemporalModelR"
)
ref_file <- system.file("extdata/rasters_raw/elevation.tif",
package = "TemporalModelR")
out_dir <- file.path(tempdir(), "rarefied")
spatiotemporal_rarefaction(
points_sp = pts_file,
output_dir = out_dir,
reference_raster = ref_file,
time_cols = c("year", "season"),
xcol = "x",
ycol = "y",
points_crs = terra::crs(terra::rast(ref_file)),
verbose = FALSE
)
Run the code above in your browser using DataLab