cormat: Heatmap and ordered table of pairwise correlations

View source: R/cormat.R

cormatR Documentation

Heatmap and ordered table of pairwise correlations

Description

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).

Usage

cormat(
  df,
  print_cors = FALSE,
  rnd = NULL,
  method = c("pearson", "kendall", "spearman")
)

Arguments

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.

Value

Returns a list of length two - plot and data frame ordered by correlations.

Author(s)

Dennis Freuer


freuerde/puzzle documentation built on March 27, 2022, 5:30 p.m.