Learn R Programming

AlleleShift (version 1.1-3)

VIF.subset: 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)

Value

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

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.

Author

Roeland Kindt (World Agroforestry, CIFOR-ICRAF)

Examples

Run this code

# \donttest{

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)
# }

Run the code above in your browser using DataLab