cormat | R Documentation |
This function is an easy way to get ordered bivariate correlations in a decreasing way and a visualisation in the form of a heatmap. It is very useful for detection of the strongest and weakest correlations, especially if the given dataset contains many variables. The function divides automatically the data into numerical and categorical variables and applies the pearson correlation on the numerical variables (categorical variables are allowed and will be ignored).
cormat( df, print_cors = FALSE, rnd = NULL, method = c("pearson", "kendall", "spearman") )
df |
A data frame (categorical variables are allowed and will be ignored). |
print_cors |
If TRUE, the pairwise correlation will be printed to the console. |
rnd |
The number of digits of the decimal place. |
Returns a list of length two - plot and data frame ordered by correlations.
Dennis Freuer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.