if (FALSE) {
occs <- read.csv(file.path(system.file(package="predicts"), "/ex/bradypus.csv"))[,2:3]
envs <- rast(list.files(path=paste(system.file(package="predicts"), "/ex", sep=""),
pattern="tif$", full.names=TRUE))
# No biome
envs <- envs[[!(names(envs) %in% "biome")]]
occs.z <- cbind(occs, terra::extract(envs, occs, ID = FALSE))
bg <- as.data.frame(predicts::backgroundSample(envs, n = 10000))
names(bg) <- names(occs)
bg.z <- cbind(bg, terra::extract(envs, bg, ID = FALSE))
os <- list(abs.auc.diff = FALSE, pred.type = "cloglog", validation.bg = "partition")
ps <- list(orientation = "lat_lat")
# Transfer envs
tr_envs <- envs * 1.5
# Plot
mod <- e@models[[1]]
# Define data as combined training values with coordinates removed
data <- rbind(e@occs, e@bg)[,3:11]
evalplot.respCurve.dens(mod, data, envs = tr_envs, var = "bio1", fun = median)
# Plot training data only, without a transfer environment
evalplot.respCurve.dens(mod, data, var = "bio1", fun = median)
}
Run the code above in your browser using DataLab