Generate correlation matrix and select variables to remove
Source:R/make_env_corr.R
make_env_corr.Rd
Generate correlation matrix and select variables to remove
Arguments
- env_df
Dataframe with environmental variables
- env_cols
Numeric or character vector defining columns in env_df that contain the variables to test for correlation.
- remove
Logical. Remove variables correlated at or above
thresh
. Correlation is found viacaret::findCorrelation()
.- thresh
Numeric. Threshold correlation value before variable is removed.
- always_remove
Character vector. Any string in this vector, if matched, will always be removed (even if not correlated).
- always_keep
Character vector. Any string in this vector, if matched, will not be removed (even if correlated).