Description Usage Arguments Details See Also Examples
Interactive correlation matrices (heat maps) with optional scatter plots.
Variables will be clustered (see details) and reordered by default. Cells
will be labeled with the column names of the input data, and if a scatter
plot is created, points will be labeled with the row names (this can be
over-ridden by using the labels
parameter).
1 2 3 4 5 6 7 8 9 10 11 |
mat |
data matrix (observations x variables) of numeric values |
group |
vector of grouping ( |
col |
a vector of colors for each unique |
labels |
optional character vector or named list of character vectors
to label each point; if |
cluster |
logical or function; if |
cor_method |
character string indicating which correlation coefficient
is to be computed; one of |
scatterplots |
logical; if |
plotOpts |
list of additional plot options; see
|
digits |
integer indicating number of significant digits to use |
If col
is given with no group
variable, the colors for each
observation will be recycled in order.
Default cluster method is stats::hclust(dist(x), method = 'average')
which will return a list containing a named vector, "order"
, which is
used to reorder the variables.
In order to pass a custom clustering function to cluster
, the
function must take a single input (a correlation matrix) and return either
a vector or a list with a named vector, "order"
.
iplotCorr
from the qtlcharts package
Other iplots:
icurve()
,
idot()
,
iscatter()
,
itree()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## heatmap only
icorr(mtcars, scatterplots = FALSE)
## with scatter plots
icorr(mtcars, group = mtcars$cyl, col = c('blue','red','green'),
plotOpts = list(corcolors = heat.colors(3)))
## larger matrix example
set.seed(1)
dat <- replicate(50, mtcars[, sample(1:11, 1), drop = FALSE])
dat <- do.call('cbind', dat)
icorr(dat, cluster = TRUE, group = mtcars$cyl)
## using a custom clustering function
icorr(dat, cluster = function(x) hclust(dist(x, method = 'maximum')))
icorr(dat, cluster = function(x) sample(seq.int(ncol(x))))
icorr(dat, cluster = function(x) list(order = order(rowMeans(x))))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.