heatmapColorDistance: Plot a heatmap of a distance matrix

View source: R/05_output_visualization.R

heatmapColorDistanceR Documentation

Plot a heatmap of a distance matrix

Description

Plots a heatmap of a symmetrical distance matrix in order to visualize similarity/dissimilarity in scores. Values are clustered by similarity using hclust.

Usage

heatmapColorDistance(
  clusterList_or_matrixObject,
  main = NULL,
  col = "default",
  margins = c(6, 8),
  ...
)

Arguments

clusterList_or_matrixObject

Either a list of identically sized dataframes with 4 columns each (3 color channels + Pct) as output by extractClusters or getHistList, or a symmetrical distance matrix as output by getColorDistanceMatrix.

main

Title for heatmap plot.

col

Color scale for heatmap from low to high. Default is colorRampPalette(c("royalblue4", "ghostwhite", "violetred2"))(299), where pink is more dissimilar and blue is more similar.

margins

Margins for column and row labels.

...

Additional arguments passed on to heatmap.2.

Value

Heatmap representation of distance matrix.

Examples

## Not run: 
# Takes a few seconds to run
cluster.list <- colordistance::getHistList(dir(system.file("extdata",
"Heliconius/", package="colordistance"), full.names=TRUE), lower=rep(0.8, 3),
upper=rep(1, 3))

CDM <- colordistance::getColorDistanceMatrix(cluster.list, plotting=FALSE)

colordistance::heatmapColorDistance(CDM, main="Heliconius color similarity")
colordistance::heatmapColorDistance(cluster.list,
col=colorRampPalette(c("red", "cyan", "blue"))(n=299))

## End(Not run)


hiweller/colordistance documentation built on Feb. 1, 2024, 7:49 p.m.