This function creates a either a static or interactive bar plot of correlations between variables in a dataset.

corrBarplot(
  mat,
  interactive = TRUE,
  pal = colorRampPalette(c("cornflowerblue", "white", "tomato"))(100)
)

Arguments

mat

A square correlation matrix to visualise.

interactive

A logical value specifying whether to create an interactive ggplotly plot, default is TRUE

pal

A colour palette for the bar plot, default is colorRampPalette(c("cornflowerblue", "white", "tomato"))(100).

Value

A static or interactive bar plot displaying correlations.

Details

Creates a static or interactive bar plot displaying correlation values. By hovering mouse over a bar, the variables and correlation value is shown.

Examples

cm <- cor(mtcars)

corrBarplot(mat = cm,
           interactive = TRUE)