Learn R Programming

ecr (version 2.1.1)

plotHeatmap: Plot heatmap.

Description

Given a matrix or list of matrizes x this function visualizes each matrix with a heatmap.

Usage

plotHeatmap(x, value.name = "Value", show.values = FALSE)

Value

[ggplot] ggplot object.

Arguments

x

[matrix | list[matrix]]
Either a matrix or a list of matrizes.

value.name

[character(1)]
Name for the values represented by the matrix. Internally, the matrix is transformed into a data.frame via melt in order to obtain a format which may be processed by ggplot easily. Default is “Value”.

show.values

[logical(1L)]
Should the values be printed within the heatmap cells? Default is FALSE.

Examples

Run this code
# simulate two (correlation) matrizes
x = matrix(runif(100), ncol = 10)
y = matrix(runif(100), ncol = 10)
if (FALSE) {
pl = plotHeatmap(x)
pl = plotHeatmap(list(x, y), value.name = "Correlation")
pl = plotHeatmap(list(MatrixX = x, MatrixY = y), value.name = "Correlation")
}

Run the code above in your browser using DataLab