plot_corr | R Documentation |
This function plots pairwise correlations between variables.
plot_corr( dat, method = "pearson", use = "everything", alpha = NULL, p_adj = NULL, lim = NULL, geom = "tile", label = FALSE, diag = FALSE, title = "Correlation Plot", legend = "right", hover = FALSE, export = FALSE )
dat |
A sample by feature data frame or matrix, e.g. of clinical variables. Non-numeric features are dropped with a warning. |
method |
String specifying which correlation coefficient to compute.
Must be one of |
use |
Optional character string giving a method for computing
covariances in the presence of missing values. Must be one of |
alpha |
Optional significance threshold to impose on correlations.
Those with p-values (optionally adjusted) less than or equal to
|
p_adj |
Optional p-value adjustment for multiple testing. Options
include |
lim |
Optional vector of length two defining lower and upper bounds for the scale range. Default is observed extrema. |
geom |
String specifying whether to visualize correlation coefficients
as |
label |
Print correlation coefficient over |
diag |
Include principal diagonal of the correlation matrix? |
title |
Optional plot title. |
legend |
Legend position. Must be one of |
hover |
Show correlation coefficient by hovering mouse over the
corresponding tile or circle? If |
export |
Export correlation matrix? If |
Correlation plots visualize the associations between numeric features. They are a valuable tool in exploratory data analysis for biological experiments, where they may help identify dependencies among clinical covariates, leading to better omic models.
If export = TRUE
, a list with up to two elements:
The correlation matrix, computed via the chosen method
.
The matrix of p-values (optionally adjusted), if alpha
is non-NULL
.
mat <- matrix(rnorm(100), 10, 10) plot_corr(mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.