Learn R Programming

SDMtune (version 1.3.2)

maxentVarImp: Maxent Variable Importance

Description

Shows the percent contribution and permutation importance of the environmental variables used to train the model.

Usage

maxentVarImp(model)

Value

A data frame with the variable importance.

Arguments

model

SDMmodel or SDMmodelCV object trained using the "Maxent" method.

Author

Sergio Vignali

Details

When an SDMmodelCV object is passed to the function, the output is the average of the variable importance of each model trained during the cross validation.

See Also

maxentTh.

Examples

Run this code
# 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
# The next line checks if Maxent is correctly configured but you don't need
# to run it in your script
model <- train(method = "Maxent",
               data = data,
               fc = "l")

maxentVarImp(model)

Run the code above in your browser using DataLab