# Paths to example data included in the package
library(terra)
FVC_raster <- rast(system.file("extdata", "FVC_reduced.tif", package = "wdiEF"))
TS_TA_raster <- rast(system.file("extdata", "TS_TA_reduced.tif", package = "wdiEF"))
# Output path (temporary file for example purposes)
output_path <- tempfile(fileext = ".tif")
# Run the function
calculate_WDI(
FVC_path = FVC_raster,
TS_TA_path = TS_TA_raster,
output_path = output_path,
n_intervals = 20,
percentile = 0.01
)
# Print the output path
print(output_path)
Run the code above in your browser using DataLab