plot_matrix: Heatmap

plot_matrixR Documentation

Heatmap

Description

Plots a heatmap.

Usage

## S4 method for signature 'matrix'
autoplot(object, ..., diag = TRUE, upper = TRUE, lower = TRUE)

## S4 method for signature 'dist'
autoplot(object, ..., diag = FALSE, upper = FALSE, lower = !upper)

## S4 method for signature 'OccurrenceMatrix'
autoplot(object, ..., diag = FALSE, upper = FALSE, lower = !upper)

## S4 method for signature 'matrix,missing'
plot(x, diag = TRUE, upper = TRUE, lower = TRUE, ...)

## S4 method for signature 'dist,missing'
plot(x, diag = FALSE, upper = FALSE, lower = !upper, ...)

## S4 method for signature 'OccurrenceMatrix,missing'
plot(x, diag = FALSE, upper = FALSE, lower = !upper, ...)

Arguments

object, x

A An object to be plotted (typically an object of class CountMatrix).

...

Currently not used.

diag

A logical scalar indicating whether the diagonal of the matrix should be plotted. Only used if object is a symmetric matrix.

upper

A logical scalar indicating whether the upper triangle of the matrix should be plotted. Only used if object is a symmetric matrix.

lower

A logical scalar indicating whether the lower triangle of the matrix should be plotted. Only used if object is a symmetric matrix.

Value

  • autoplot() returns a ggplot object.

  • plot() is called it for its side-effects: it results in a graphic being displayed (invisibly returns x).

Author(s)

N. Frerebeau

References

Desachy, B. (2004). Le sériographe EPPM: un outil informatisé de sériation graphique pour tableaux de comptages. Revue archéologique de Picardie, 3(1), 39-56. doi: 10.3406/pica.2004.2396.

See Also

pvi()

Other plot: plot_bar, plot_diversity, plot_line, plot_spot()

Examples

## Abundance data (data from Desachy 2004)
data("compiegne", package = "folio")
## Coerce dataset to absolute frequencies
counts <- as_count(compiegne)
## Coerce dataset to relative frequencies
freq <- as_composition(compiegne)

## Plot matrix diagram...
plot(counts)
plot(freq)

## Presence/absence data
inc <- sample(0:1, size = 100, replace = TRUE)
bin <- IncidenceMatrix(data = inc, nrow = 10, ncol = 10)

autoplot(bin) +
  ggplot2::scale_fill_manual(values = c("TRUE" = "black", "FALSE" = "white"))

tesselle/tabula documentation built on April 29, 2022, 4:01 p.m.