Learn R Programming

matrixCorr (version 0.8.3)

view_corr_shiny: Interactive Shiny viewer for matrixCorr objects

Description

Launches an interactive Shiny gadget that displays correlation heatmaps with filtering, clustering, and hover inspection. The viewer accepts any matrixCorr correlation result (for example the outputs from pearson_corr(), spearman_rho(), kendall_tau(), biweight_mid_corr(), partial_correlation(), distance_corr(), or schafer_corr()), a plain matrix, or a named list of such objects. When a list is supplied the gadget offers a picker to switch between results.

Usage

view_corr_shiny(x, title = NULL, default_max_vars = 40L)

Value

Invisibly returns NULL; the function is called for its side effect of launching a Shiny gadget.

Arguments

x

A correlation result, a numeric matrix, or a named list of those objects. Each element must be square with matching row/column names.

title

Optional character title shown at the top of the gadget.

default_max_vars

Integer; maximum number of variables pre-selected when the app opens. Defaults to 40 so very wide matrices start collapsed.

Details

This helper lives in Suggests; it requires the shiny and shinyWidgets packages at runtime and will optionally convert the plot to an interactive widget when plotly is installed. Variable selection uses a searchable picker, and clustering controls let you reorder variables via hierarchical clustering on either absolute or signed correlations with a choice of linkage methods.

Examples

Run this code
if (interactive()) {
  data <- mtcars
  results <- list(
    Pearson = pearson_corr(data),
    Spearman = spearman_rho(data),
    Kendall = kendall_tau(data)
  )
  view_corr_shiny(results)
}

Run the code above in your browser using DataLab