# NOT RUN {
# Acquire environmental variables
files <- list.files(path = file.path(system.file(package = "dismo"), "ex"),
pattern = "grd", full.names = TRUE)
predictors <- raster::stack(files)
# Prepare background locations
bg_coords <- dismo::randomPoints(predictors, 10000)
# Create SWD object
bg <- prepareSWD(species = "Vultur gryphus", coords = bg_coords,
env = predictors, categorical = "biome")
# Plot heat map
plotCor(bg, method = "spearman")
# Plot heat map showing only values higher than given threshold
plotCor(bg, method = "spearman", cor_th = 0.8)
# }
Run the code above in your browser using DataLab