Description Usage Arguments Value Author(s) References Examples
Selects variables within a dataframe that are not correlated with each other, or with linear combinations of other variables, by using the variance inflation factor (VIF) criteria implemented in the vif
function (Heilberger and Holland 2004).
1 2 3 4 5 |
x |
A data frame with numeric columns. |
try.to.keep |
A character vector with the names of the variables the user would like to keep, in order of preference. If this argument is not |
verbose |
Boolean, defaults to TRUE. Triggers messages describing what variables are being removed. |
A character vector with the names of the selected variables.
Blas Benito <blasbenito@gmail.com>. The function vif
is authored by Richard M. Heiberger <rmh@temple.edu>.
Heiberger, Richard M. and Holland, Burt (2004). Statistical Analysis and Data Display: An Intermediate Course with Examples in S-Plus, R, and SAS. Springer Texts in Statistics. Springer. ISBN 0-387-40270-5.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ## Not run:
data("europe2000")
df <- raster::as.data.frame(europe2000[[c("bio1", "bio5", "bio6", "bio11", "bio12")]])
selected.vars <- SDMworkshop::autoVIF(
x = df,
try.to.keep = c("bio5", "bio6", "bio1"),
verbose = TRUE
)
selected.vars
#autoVIF can also take the output of SDMworkshop::biserialCorrelation
#as try.to.keep argument, as follows:
data(virtualSpeciesPB)
cPB <- SDMworkshop::biserialCorrelation(
x = virtualSpeciesPB,
presence.column = "presence",
variables = c("bio1", "bio5", "bio6")
)
#note that cPB$df$variable is ordered from
#higher to lower biserial correlation
#higher biserial correlation is linked
#to higher predictive importance
selected.vars <- SDMworkshop::autoVIF(
x = df,
try.to.keep = cPB$df$variable,
verbose = TRUE
)
selected.vars
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.