heatmapColorDistance: Plot a heatmap of a distance matrix

Description Usage Arguments Value Examples

View source: R/05_output_visualization.R

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

1
2
3
4
5
6
7
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)

colordistance documentation built on March 21, 2021, 1:06 a.m.