This function creates an interactive heatmap of correlations between variables in a dataset.

corrHeatmap(
  mat,
  display = c("all", "upper", "lower"),
  reorder = TRUE,
  pal = colorRampPalette(c("darkblue", "white", "darkred"))(100)
)

Arguments

mat

A square correlation matrix to visualise.

display

A character vector specifying which part of the correlation matrix to display: 'all', 'upper', or 'lower', default is 'all'.

reorder

A logical value indicating whether to reorder the heatmap based on hierarchical clustering, default is TRUE.

pal

A color palette for the heatmap.

Value

An interactive heatmap plot displaying correlations.

Details

Creates an interactive heatmap displaying correlation values. By hovering mouse over a cell, the variables and correlation value is shown.

Examples

cm <- cor(mtcars)

corrHeatmap(mat = cm,
           display = 'all')