heatmapSpp {spider} | R Documentation |
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,
triangle = "both", showData = FALSE, dataRound = 3, dataCEX = 1)
Arguments
distObj |
A matrix or object of class |
sppVector |
The species vector. See |
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. |
triangle |
Which triangle of the heatmap should be plotted. Possible values of "both", "upper" and "lower". Default of "both". |
showData |
Logical. Should the data be shown on the heatmap? Default of FALSE. |
dataRound |
The number of significant figures the printed data will show. Default of 3. |
dataCEX |
Size of text for printed data. Default of 1. |
Details
The default palette has been taken from the colorspace
package.
Value
Plots a heatmap of the distance matrix. Darker colours indicate shorter distances, lighter colours indicate greater distances.
Author(s)
Samuel Brown <s_d_j_brown@hotmail.com>
Examples
data(dolomedes)
doloDist <- ape::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 <- ape::dist.dna(anoteropsis, model = "raw")
anoSpp <- sapply(strsplit(dimnames(anoteropsis)[[1]], split="_"),
function(x) paste(x[1], x[2], sep="_"))
heatmapSpp(anoDist, anoSpp)
heatmapSpp(anoDist, anoSpp, showData = TRUE)
heatmapSpp(anoDist, anoSpp, showData = TRUE, dataRound = 1, dataCEX = 0.4)
heatmapSpp(anoDist, anoSpp, triangle = "upper")
heatmapSpp(anoDist, anoSpp, triangle = "lower")
heatmapSpp(anoDist, anoSpp, triangle = "lower", showData = TRUE, dataRound = 1, dataCEX = 0.4)