plotPairwiseMatrix: Plot pairwise divergence or overlap as calculated by...

Description Usage Arguments Details Value References See Also Examples

View source: R/plotPairwiseMatrix.R

Description

Plot lower-triangular matrix of pairwise divergence or overlap values using a colour scale and levelplot from the lattice package. The mean value may be included.

Usage

1
2
3
4
5
6
7
8
plotPairwiseMatrix(x, statistic = c("divergence", "overlap"),
  pairwise.mean = NULL, mean.position = c(0.45, 0.3), bty = "L",
  aspect = "iso", col.regions = function(x) gray(c(1, seq(0.9, 0.6,
  length.out = (x - 2)), 0)), colorkey = list(labels = list(cex = 1)),
  at = c(0, 0.01, seq(0.2, 0.8, 0.2), 0.99, 1), scales = list(draw = FALSE,
  tck = 0, cex = 0.7, x = list(rot = 90)), axis.label = "Group",
  xlab = list(axis.label, cex = 1), ylab = list(axis.label, cex = 1),
  digits = getOption("digits"), ...)

Arguments

x

Pairwise divergence or overlap matrix as found at, e.g., diversity()$q$diversity.mat. Currently, prior to plotting this matrix has its diagonal and upper triangle zeroed, and is then rotated prior to passing to lattice::levelplot.

statistic

"divergence" or "overlap", indicating the statistic being supplied for plotting

pairwise.mean

Mean pairwise divergence or overlap as found at, e.g., diversity()$q$divergence. If provided, this is added to the plot in the upper triangle, rounded to three digits, with positions specified by mean.pos. The value is plotted together with '\bar{δ} = ' if statistic is "divergence", and '\bar{ω} = ' if statistic is "overlap".

bty, aspect, col.regions, colorkey, at, scales, xlab, ylab

Additional plot options passed to lattice::levelplot

axis.label

Label used for the X and Y axes, the X and Y axis labels can be changed with xlab and ylab

digits

Number of digits to use when printing mean value, taken from the "digits" option if not supplied

mean.pos

If pairwise.mean is given, the relative X and Y positions within the panel at which the value is plotted, in a two-element vector. adj = c(0, 0) is used when plotting the value.

Details

The default colour scheme used is grayscale, with white and black used for values very near the extremes (within 0.01 of 0 and 1, respectively). Options are available for modifying the colour scheme.

Value

The class lattice plot object is returned invisibly

References

Scofield, D. G., Smouse, P. E., Karubian, J. and Sork, V. L. (2012) Use of alpha, beta and gamma diversity measures to characterize seed dispersal by animals. American Naturalist 180:719-732.

See Also

diversity, lattice::levelplot

Examples

1
2
3
4
5
6
data(granaries_2002_Qlob)
d <- diversity(granaries_2002_Qlob)
plotPairwiseMatrix(x = d$r$divergence.mat,
                   pairwise.mean = d$r$divergence,
                   statistic = "divergence",
                   axis.label = "Granary")

douglasgscofield/dispersalDiversity documentation built on March 30, 2021, 9:50 a.m.