correlation_finder: Function to find out strong correlations in a correlation...

Description Usage Arguments Value Examples

View source: R/correlation_finder.R

Description

The function finds out which variables have strong correlations according to a correlation threshold. The output returns a list of variables names that can summarize the information and removes the variables that are redundant.

Usage

1
correlation_finder(cor_mat, threshold, verbose = TRUE)

Arguments

cor_mat

A correlation matrix.

threshold

Threshold valuefrom which it is considered that the correlation is high.

verbose

Verbose output.

Value

Returns a vector with variable names that can summarize the information.

Examples

1
2
3
4
5
6
7
8
9
# library(Matrix)
# set.seed(111)
# mat_cor <-Matrix(runif(16), 4)
# mat_cor <- forceSymmetric(mat_cor)
# diag(mat_cor) <- 1
# colnames(mat_cor) <- c(paste0("var_",1:4))
# Correlation matrix
# cor_mat <- data.frame(as.matrix(mat_cor))
# correlation_finder(cor_mat = cor_mat ,threshold = 0.7,verbose = TRUE)

luismurao/nichetoolbox documentation built on May 21, 2019, 8:56 a.m.