View source: R/SDMmodel2MaxEnt.R
SDMmodel2MaxEnt | R Documentation |
Converts an SDMmodel object containing a MaxEnt model into a dismo MaxEnt object.
SDMmodel2MaxEnt(model)
model |
SDMmodel object to be converted. |
The converted dismo MaxEnt object.
Sergio Vignali
# Acquire environmental variables
files <- list.files(path = file.path(system.file(package = "dismo"), "ex"),
pattern = "grd",
full.names = TRUE)
predictors <- terra::rast(files)
# Prepare presence and background locations
p_coords <- virtualSp$presence
bg_coords <- virtualSp$background
# Create SWD object
data <- prepareSWD(species = "Virtual species",
p = p_coords,
a = bg_coords,
env = predictors,
categorical = "biome")
# Train a Maxent model
model <- train(method = "Maxent",
data = data,
fc = "l")
dismo_model <- SDMmodel2MaxEnt(model)
dismo_model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.