plotmat: Plot matrix as heatmap

View source: R/matrix.R

plotmatR Documentation

Plot matrix as heatmap

Description

Plot matrix as heatmap

Usage

plotmat(x, text = FALSE, plot = TRUE, ...)

Arguments

x

A matrix.

text

Whether to print the values of the matrix as text (defaults to FALSE).

plot

Whether to plot the resulting ggplot object (defaults to TRUE).

...

Ignored.

Value

Invisibly returns the ggplot object for further modification.

Author(s)

Sercan Kahveci

Examples

# Create a matrix to plot
mymat <- matrix(rnorm(100), nrow=10)
mymat <- mymat + t(mymat)
mymat[cbind(sample(c(1:10)), sample(c(1:10)))] <- NA
colnames(mymat) <- rownames(mymat) <- sample(letters[1:10])

plotmat(mymat)


Spiritspeak/skMisc documentation built on April 12, 2025, 5:40 a.m.