Description Usage Arguments Value See Also Examples
A wrapper for heatmap
from the stats package
and heatmap.2
from the gplots package with
some adaptations likely to be useful for
OmniLog(R) data.
The data-frame and OPMS
methods extract a
numeric matrix from a given data frame or
OPMS
object and pass the result to the
matrix method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ## S4 method for signature 'MOPMX'
heat_map(object, as.labels,
subset = opm_opt("curve.param"), as.groups = NULL, sep = " ",
extract.args = list(), ...)
## S4 method for signature 'OPMS'
heat_map(object, as.labels,
subset = opm_opt("curve.param"), as.groups = NULL, sep = " ",
extract.args = list(), ...)
## S4 method for signature 'data.frame'
heat_map(object, as.labels, as.groups = NULL, sep = " ", ...)
## S4 method for signature 'matrix'
heat_map(object,
hclustfun = "ward.D2", distfun = "euclidean", scale = "none",
r.groups = "row.groups", r.col = opm_opt("colors"),
c.groups = "col.groups", c.col = opm_opt("colors"),
magnif = 4, cexRow = magnif[1L] / sqrt(nrow(object)),
cexCol = magnif[length(magnif)] / sqrt(ncol(object)),
borders = c(0.55, 0.75),
margins = if (use.fun[1L] == "gplots")
c(borders[1L] * cexCol * max(nchar(colnames(object))),
borders[length(borders)] * cexRow * max(nchar(rownames(object))))
else
c(5, 5),
col = opm_opt("heatmap.colors"), asqr = FALSE, log1 = FALSE, lmap = 1L:3L,
abbrev = c("none", "row", "column", "both"), plot.na = "plot.NA",
reorderfun = function(d, w) reorder(d, w, mean), ...,
use.fun = c("gplots", "stats"))
|
object |
Matrix, data frame or |
as.labels |
Character, numeric or logical vector
indicating the positions of the columns to be joined and
used as row labels. If |
as.groups |
Character, numeric or logical vector
indicating the positions of the columns to be joined and
used as group indicators. If |
sep |
Character scalar determining how to join row
and group names. See |
subset |
Character scalar passed to the
|
extract.args |
Optional list of arguments passed to that method. |
hclustfun |
Determines the clustering method used.
If a function, used directly. If a character scalar, used
as the ‘method’ argument of |
distfun |
Determines the distance method used. If a
function, used directly. If a character scalar, used as
the ‘method’ argument of |
scale |
Character scalar. See |
r.groups |
Determines the plotting of a colour bar indicating row groups. If Finally the groups are converted to a factor and used for
selecting from |
r.col |
Character vector of colour names used by
|
c.groups |
Determines the plotting of a colour bar indicating column groups. If Finally the groups are converted to a factor and used for
selecting from |
c.col |
Character vector of colour names used by
|
magnif |
Numeric vector. Factor(s) used per default
by |
cexRow |
Magnification of the row labels. |
cexCol |
Magnification of the column labels. |
borders |
Numeric vector. Factor(s) used per default
by |
margins |
Two-element numeric vector determining the relative size of the margin (i) at the bottom and (ii) at the left. |
col |
Character vector containing the proper heat map colours. |
asqr |
Logical scalar indicating whether the data
should be treated with the arcsine-square root
transformation. This usually only makes sense for
proportion data and cannot be used in conjunction with
the |
log1 |
Logical scalar indicating whether
|
lmap |
Numeric scalar with at least three elements,
or empty. If empty, ignored. Otherwise used for mapping
logical values to numeric values. See
|
abbrev |
Character scalar indicating whether row or column shall be abbreviated before plotting. Note that abbreviation is done by shortening words and ending them with a dot, so there is no guarantee that a certain maximum length will be obtained. |
plot.na |
Character scalar with the name of an
optional attribute that contains replacement values for
|
reorderfun |
Function passed to |
... |
Optional arguments passed to |
use.fun |
Character scalar. If gplots, it is
attempted to load the gplots package and use its
|
A list as output by heatmap
or heatmap.2
with the additional entries rowColMap
or
colColMap
giving the mapping(s) of group names to
colours as named character vector(s), if this feature was
used.
stats::heatmap gplots::heatmap.2
Other plotting-functions: ci_plot
,
level_plot
, parallel_plot
,
parallelplot
, radial_plot
,
summary
, xy_plot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # temporarily disabled until an error specific for Windows on
# R-Forge is fixed; needs not affect user code, Windows users
# can well try heat_map()
if (!grepl("windows", Sys.info()[["sysname"]], TRUE, TRUE)) {
# Matrix method (usually unnecessary, see below)
x <- extract(vaas_4, as.labels = list("Strain"),
as.groups = list("Species"))
hm <- heat_map(x)
stopifnot(identical(metadata(vaas_4, "Species"), names(hm$rowColMap)))
# 'OPMS' method (more convenient)
hm.2 <- heat_map(vaas_4, as.labels = "Strain", as.groups = "Species")
stopifnot(identical(hm[-3], hm.2[-3]))
# Data-frame method
x <- extract(vaas_4, as.labels = list("Species", "Strain"), dataframe = TRUE)
hm <- heat_map(x, as.labels = "Strain", as.groups = "Species")
stopifnot(identical(metadata(vaas_4, "Species"), names(hm$rowColMap)))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.