Learn R Programming

mvtboost (version 0.5.0)

mvtb.heat: Clustered heatmap of tables from mvtb

Description

Simple (clustered) heatmap of tables from mvtb (relative influence, covariance explained)

Usage

mvtb.heat(x, clust.method = "ward.D", dist.method = "manhattan", dec = 2, numformat = NULL, col = NULL, cexRow = NULL, cexCol = NULL, ...)

Arguments

x
Any table. For example: the covariance explained from mvtb.covex, or relative influence mvtb.ri(res).
clust.method
clustering method for rows and columns. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC). If NULL, unclustered.
dist.method
method for computing the distance between two lower triangular covariance matrices. This must be one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". Any unambiguous substring can be given.
dec
Number of decimal places to round to if numformat is unspecified. Defaults to 2.
numformat
function to format the covex values into strings. Defaults to removing leading 0 and rounding to dec = 2 decimal places.
col
A list of colors mapping onto covex explained values. A white to black gradient is default.
cexRow,
See cex.axis from par. The magnification used for the row axis labels. A useful default is provided.
cexCol,
See cex.axis from par. The magnification used for the col axis labels. The default is set equal to the row axis labels.
...
extra arguments are passed to image, then to plot. See ?image, ?par

Value

heatmap of x, usually a covariance explained matrix or a matrix of (relative) influences.

Details

The row and column names of x are used for the labels. See the examples for modifying the default colors.

See Also

plot.mvtb, mvtb.perspec

Examples

Run this code
data(wellbeing)
Y <- wellbeing[,21:26]
X <- wellbeing[,1:20]
Ys <- scale(Y)
cont.id <- unlist(lapply(X,is.numeric))
Xs <- scale(X[,cont.id])

res <- mvtb(Y=Ys,X=Xs)

covex <- mvtb.covex(res, Y=Ys, X=Xs)
par(mar=c(4,7,1,1))
mvtb.heat(covex,cexRow=.8)

col <- colorRampPaletteAlpha(RColorBrewer::brewer.pal(9,"Greys"),100)
mvtb.heat(covex, Y=Ys, X=Xs, col=col, cexRow=.8)

par(mar=c(5,5,1,1))
mvtb.heat(t(mvtb.ri(res)),cexRow=.8,cexCol=1,dec=0)

Run the code above in your browser using DataLab