Learn R Programming

caretSDM (version 1.1.0.1)

vif_predictors: Calculate VIF

Description

Apply Variance Inflation Factor (VIF) calculation.

Usage

vif_predictors(pred, area = "all", th = 0.5, maxobservations = 5000, variables_selected =
NULL)

vif_summary(i)

selected_variables(i)

Value

A input_sdm or predictors object with VIF data.

Arguments

pred

A input_sdm or predictors object.

area

Character. Which area should be used in vif selection? Standard is "all".

th

Threshold to be applied in VIF routine. See ?usdm::vifcor.

maxobservations

Max observations to use to calculate the VIF.

variables_selected

If there is a subset of predictors that should be used in this function, it can be informed using this parameter. If set to NULL (standard) all variables are used.

i

A input_sdm to retrieve information from.

Author

Luíz Fernando Esser (luizesser@gmail.com) https://luizfesser.wordpress.com

Details

vif_predictors is a wrapper function to run usdm::vifcor in caretSDM.

See Also

get_predictor_names

Examples

Run this code
# Create sdm_area object:
sa <- sdm_area(parana, cell_size = 25000, crs = 6933)

# Include predictors:
sa <- add_predictors(sa, bioc) |> select_predictors(c("bio1", "bio4", "bio12"))

# Include scenarios:
sa <- add_scenarios(sa, scen)

# Create occurrences:
oc <- occurrences_sdm(occ, crs = 6933) |> join_area(sa)

# Create input_sdm:
i <- input_sdm(oc, sa)

# VIF calculation:
i <- vif_predictors(i)
i

# Retrieve information about vif:
vif_summary(i)
selected_variables(i)

Run the code above in your browser using DataLab