Description Usage Arguments Details Value References Examples
View source: R/membershipPlot.R
Plot a series of stacked bars indicating membership of species across
sites, items across groups, or however the contents of tab
should
be interpreted. In the descriptions below we will treat tab
as
describing species counts across sites.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Default S3 method:
membershipPlot(tab, ...)
## S3 method for class 'divtable'
membershipPlot(tab, fill.method = c("colour", "bw",
"color"), fill.palette = "Dark2", distinguish.multiton = TRUE,
xlab = "Site", ylab = "Membership", las = 1, x.mar.width = ifelse(las
>= 2, 4, 3), cex = 0.7, cex.names = 0.85, l1 = NULL, l2 = NULL,
annotate.cex = 0.9, annotate = function() { xl <- seq(0.8, by = 1.3,
length.out = max(length(l1), length(l2))) if (!is.null(l1))
mtext(l1, at = xl, line = 0.8, cex = annotate.cex, xpd = NA) if
(!is.null(l2)) mtext(l2, at = xl, line = 0.4, cex = annotate.cex, xpd
= NA) }, file = NULL, file.dim = c(5.25, 2), ...)
|
tab |
Object of class |
fill.method |
|
fill.palette |
For |
distinguish.multiton |
For |
xlab, ylab, las, cex |
Plot parameters (see |
x.mar.width |
Width of the X-margin |
cex.names |
Character expansion factor for the names plotted below the bars |
l1, l2, annotate.cex, annotate |
First and second lines of annotation
to appear above bars in a bar plot, the character expansion factor to use,
and the function to place them there. Alternate annotations may be
enabled by redefining |
file |
If specified, produce PDF output to |
file.dim |
If |
In the plot, species are ordered bottom to top in order of decreasing total
abundance. Species which are present in more than one site are given a
unique colour/hatching combination, with hatching used only if the number of
species is greater than the number of readily distinguishable colours,
currently set to 8. Multiton species, with more than one individual but all
individual appearing within a single site, are coloured grey when
fill.method = "colour"
, and are coloured white when fill.method
= "bw"
or distinguish.multiton = FALSE
. Singleton groups, those with
just one member, are coloured white within their respective sites.
Examples of membership plots in publications can be found in Scofield et al. (2010), Scofield et al. (2011) and Scofield et al. (2012).
No value is returned
Scofield, D. G., Sork, V. L. and Smouse, P. E. (2010) Influence of acorn woodpecker social behaviour on transport of coast live oak (Quercus agrifolia) acorns in a southern California oak savanna. Journal of Ecology 98:561-572.
Scofield, D. G., Alfaro, V. R., Sork, V. L., Grivet, D., Martinez, E., Papp, J., Pluess, A. R., Koenig, W. D. and Smouse, P. E. (2011) Foraging patterns of acorn woodpeckers (Melanerpes formicivorus) on valley oak (Quercus lobata N\'ee) in two California oak savanna-woodlands. Oecologia 166:187-196.
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.
1 2 3 4 5 6 7 8 9 10 11 | ## create table of random membership data
n.sites <- 5
n.sources <- 10
n.samples <- 160
## data frame of site-source pairs
set.seed(75333)
t <- data.frame(site = sample(n.sites, n.samples, replace = TRUE),
source = round(runif(n.samples) * n.sources + 0.5))
## create site-by-source table
tab <- as.divtable(table(t))
membershipPlot(tab)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.