Learn R Programming

spider (version 1.2-0)

heatmapSpp: Visualise a distance matrix using a heatmap

Description

This function plots a heatmap of the distance matrix, with shorter distances indicated by darker colours.

Usage

heatmapSpp(distObj, sppVector, col = NULL, axisLabels = NULL)

Arguments

distObj
A matrix or object of class dist.
sppVector
The species vector. See sppVector.
col
A vector giving the colours for the heatmap.
axisLabels
A character vector that provides the axis labels for the heatmap. By default the species vector is used.

Value

  • Plots a heatmap of the distance matrix. Darker colours indicate shorter distances, lighter colours indicate greater distances.

Details

The default palette has been taken from the colorspace package.

Examples

Run this code
data(dolomedes)
doloDist <- dist.dna(dolomedes, model = "raw")
doloSpp <- substr(dimnames(dolomedes)[[1]], 1, 5)
heatmapSpp(doloDist, doloSpp)
heatmapSpp(doloDist, doloSpp, axisLabels = dimnames(dolomedes)[[1]])

data(anoteropsis)
anoDist <- dist.dna(anoteropsis, model = "raw")
anoSpp <- sapply(strsplit(dimnames(anoteropsis)[[1]], split="_"), 
    function(x) paste(x[1], x[2], sep="_"))
heatmapSpp(anoDist, anoSpp)

Run the code above in your browser using DataLab