Plots a heatmap.
Usage
plot_heatmap(object, ...)
# S4 method for matrix
plot_heatmap(object, diag = TRUE, upper = TRUE, lower = TRUE, freq = FALSE)
# S4 method for data.frame
plot_heatmap(object, diag = TRUE, upper = TRUE, lower = TRUE, freq = FALSE)
# S4 method for dist
plot_heatmap(object, diag = FALSE, upper = FALSE, lower = !upper)
Arguments
- object
A \(m \times p\)
numeric
matrix
ordata.frame
of count data (absolute frequencies giving the number of individuals for each class).- ...
Currently not used.
- diag
A
logical
scalar indicating whether the diagonal of the matrix should be plotted. Only used ifobject
is a symmetric matrix.- upper
A
logical
scalar indicating whether the upper triangle of the matrix should be plotted. Only used ifobject
is a symmetric matrix.- lower
A
logical
scalar indicating whether the lower triangle of the matrix should be plotted. Only used ifobject
is a symmetric matrix.- freq
A
logical
scalar indicating whether relative frequency should be used instead of counts (absolute frequency).
Value
A ggplot2::ggplot object.
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
Other plot methods:
plot_bar
,
plot_diversity
,
plot_line
,
plot_spot()
Examples
## Abundance data (data from Desachy 2004)
data("compiegne", package = "folio")
## Plot matrix diagram...
plot_heatmap(compiegne)
plot_heatmap(compiegne, freq = TRUE)
## Presence/absence data
inc <- sample(0:1, size = 100, replace = TRUE)
bin <- matrix(data = as.logical(inc), nrow = 10, ncol = 10)
plot_heatmap(bin) +
ggplot2::scale_fill_manual(values = c("TRUE" = "black", "FALSE" = "white"))