# Independent test data based on coordinates (lon/lat WGS 84) from presence
# and absences records
data("test", package = "enmpa")
head(test)
# Loading a model prediction
pred <- terra::rast(system.file("extdata", "proj_out_wmean.tif",
package = "enmpa"))
terra::plot(pred)
# Evaluation using presence-absence data
independent_eval01(prediction = pred, observation = test$Sp,
lon_lat = test[, 2:3])
# Evaluation using presence-only data
test_p_only <- test[test$Sp == 1, ]
th_maxTSS <- 0.1274123 # threshold based on the maxTSS
independent_eval1(prediction = pred, threshold = th_maxTSS,
lon_lat = test_p_only[, 2:3])
Run the code above in your browser using DataLab