Skip to contents

Converts an SDMmodel object containing a Maxent model into a dismo MaxEnt object.

Usage

SDMmodel2MaxEnt(model)

Arguments

model

SDMmodel object to be converted.

Value

The converted dismo MaxEnt object.

Author

Sergio Vignali

Examples

# 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")
#>  Extracting predictor information for presence locations
#>  Extracting predictor information for presence locations [72ms]
#> 
#>  Extracting predictor information for absence/background locations
#>  Extracting predictor information for absence/background locations [150ms]
#> 

# Train a Maxent model
model <- train(method = "Maxent",
               data = data,
               fc = "l")
#> Loading required namespace: rJava

dismo_model <- SDMmodel2MaxEnt(model)
dismo_model
#> class    : MaxEnt 
#> variables: bio1 bio12 bio16 bio17 bio5 bio6 bio7 bio8 biome 
#> output html file no longer exists