| iplotCorr | R Documentation |
Creates an interactive graph with an image of a correlation matrix linked to underlying scatterplots.
iplotCorr(
mat,
group = NULL,
rows = NULL,
cols = NULL,
reorder = FALSE,
corr = NULL,
scatterplots = TRUE,
chartOpts = NULL,
digits = 5
)
mat |
Data matrix (individuals x variables) |
group |
Optional vector of groups of individuals (e.g., a genotype) |
rows |
Selected rows of the correlation matrix to include in
the image. Ignored if |
cols |
Selected columns of the correlation matrix to include
in the image. Ignored if |
reorder |
If TRUE, reorder the variables by
clustering. Ignored if |
corr |
Correlation matrix (optional). |
scatterplots |
If |
chartOpts |
A list of options for configuring the chart (see the coffeescript code). Each element must be named using the corresponding option. |
digits |
Round data to this number of significant digits before passing to the chart function. (Use NULL to not round.) |
corr may be provided as a subset of the overall
correlation matrix for the columns of mat. In this case, the
reorder, rows and cols arguments are ignored. The row and
column names of corr must match the names of some subset of
columns of mat.
Individual IDs are taken from rownames(mat); they must match
names(group).
An object of class htmlwidget that will
intelligently print itself into HTML in a variety of contexts
including the R console, within R Markdown documents, and within
Shiny output bindings.
iheatmap(), scat2scat(), iplotCurves()
data(geneExpr)
iplotCorr(geneExpr$expr, geneExpr$genotype, reorder=TRUE,
chartOpts=list(cortitle="Correlation matrix",
scattitle="Scatterplot"))
# use Spearman's correlation
corr <- cor(geneExpr$expr, method="spearman", use="pairwise.complete.obs")
# order by hierarchical clustering
o <- hclust(as.dist(1-corr))$order
iplotCorr(geneExpr$expr[,o], geneExpr$genotype, corr=corr[o,o],
chartOpts=list(cortitle="Spearman correlation",
scattitle="Scatterplot"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.