Description Usage Arguments Value Examples
View source: R/correlation_finder.R
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.
1 | correlation_finder(cor_mat, threshold, verbose = TRUE)
|
cor_mat |
A correlation matrix. |
threshold |
Threshold valuefrom which it is considered that the correlation is high. |
verbose |
Verbose output. |
Returns a vector with variable names that can summarize the information.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.