autoSelectVariables: Automatic selection of predictive variables for species...

Description Usage Arguments Value Author(s) Examples

View source: R/autoSelectVariables.R

Description

Applies biserialCorrelation, correlationDendrogram (with correlation threshold set to 0.5), and autoVIF to automatically select a set of non-correlated variables with the higher biserial correlation as possible.

Usage

1
2
3
4
5
6
7
8
autoSelectVariables(
  x,
  presence.column = "presence",
  variables = NULL,
  exclude.variables = NULL,
  plot = TRUE,
  label.size = 6
)

Arguments

x

A data frame with a presence column with 1 indicating presence and 0 indicating background, and columns with predictor values.

presence.column

Character, name of the presence column.

variables

Character vector, names of the columns representing predictors. If NULL, all numeric variables but presence.column are considered.

exclude.variables

Character vector, variables to exclude from the analysis.

plot

Boolean, if TRUE, prints last correlation dendrogram to test the final output.

label.size

Numeric, size of the dendrogram labels.

Value

A character vector with the names of the selected variables.

Author(s)

Blas Benito <blasbenito@gmail.com>.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
data(virtualSpeciesPB)
selected.vars <- autoSelectVariables(
  x = virtualSpeciesPB,
  presence.column = "presence",
  exclude.variables = c("x", "y")
)
selected.vars
HH::vif(virtualSpeciesPB[, selected.vars])
cor(virtualSpeciesPB[, selected.vars])

## End(Not run)

BlasBenito/SDMworkshop documentation built on March 4, 2020, 4:16 a.m.