heatmapSpp: Visualise a distance matrix using a heatmap

Description Usage Arguments Details Value Author(s) Examples

Description

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

Usage

1
2
heatmapSpp(distObj, sppVector, col = NULL, axisLabels = NULL, triangle = "both", 
	showData = FALSE, dataRound = 3, dataCEX = 1)

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.

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

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

spider documentation built on May 2, 2019, 5:16 p.m.