Create an interactive Sankey diagram to visualize correlations

corrSankey(mat, threshold = 0, colour = FALSE)

Arguments

mat

A square correlation matrix to visualise.

threshold

A numeric value indicating the minimum absolute correlation value to include in the diagram. Default is 0 (include all correlations).

colour

A logical value indicating whether to color the links based on positive or negative correlation. Default is FALSE (links are grey).

Value

A plotly Sankey diagram object.

Details

This function generates a Sankey diagram for a given data frame, correlation method, and correlation threshold, with an optional colour parameter.

Examples

cm <- cor(mtcars)
corrSankey(mat = cm, threshold = 0.6)
corrSankey(mat = cm, threshold = 0.8, colour = TRUE)