View source: R/view_corr_shiny.R
| view_corr_shiny | R Documentation |
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(), bicor(),
pbcor(), wincor(), skipped_corr(), pcorr(), dcor(), or
shrinkage_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.
view_corr_shiny(x, title = NULL, default_max_vars = 40L)
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. |
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.
Invisibly returns NULL; the function is called for its side
effect of launching a Shiny gadget.
if (interactive()) {
data <- mtcars
results <- list(
Pearson = pearson_corr(data),
Spearman = spearman_rho(data),
Kendall = kendall_tau(data)
)
view_corr_shiny(results)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.