VIF.subset: Reduce the Climate Data based on Variance Inflation Factor...

View source: R/VIF.subset.R

VIF.subsetR Documentation

Reduce the Climate Data based on Variance Inflation Factor Analysis.

Description

Through Variance Inflation Factor (VIF) analysis, a subset of variables is indentified where all variables have VIF below a predefined threshold.

Usage


VIF.subset(data, VIF.max, keep=NULL, silent=FALSE, cor.plot=TRUE)

Arguments

data

(Bio)-Climatic or environmental descriptors of the populations

VIF.max

Maximum Variance Inflation Factor as in ensemble.VIF.dataframe that is used internally.

keep

Variables to keep as in as in ensemble.VIF.dataframe.

silent

Limit the verbose output as in ensemble.VIF.dataframe.

cor.plot

Generate a correlation matrix for the final subset via ggcorr.

Value

The function returns information on a subset of variables where VIF is below a pre-defined threshold.

Author(s)

Roeland Kindt (World Agroforestry, CIFOR-ICRAF)

Examples




data(Poptri.baseline.env)

# error as many variables are highly correlated
# VIF.subset(Poptri.baseline.env)

VIF.subset(Poptri.baseline.env, keep=c("MAT", "CMI"), cor.plot=TRUE)


AlleleShift documentation built on Nov. 2, 2023, 6:08 p.m.