Description Usage Arguments Value References See Also Examples
View source: R/diversity-divtable.R
Given a sites-by-counts matrix, calculate a collection of diversity statistics. Statistics include PMI (probability of maternal inheritance) from Grivet et al. (2005) and Scofield et al. (2010, 2011) as well as alpha, beta, gamma and delta/omega from classical ecology and applied to a dispersal context by Scofield et al. (2012).
Calculate diversity for allele_divtables
object using diversityMultilocus
1 2 3 4 5 6 7 8 |
tab |
|
x |
Object of class |
... |
Additional arguments, currently ignored |
... |
Additional arguments passed to
|
A list of class diversity
containing three forms of
diversity statistics, each returned as lists under separate named
elements:
q
, based on squared frequencies, known to be biased at
smaller sample sizes
r
, unbiased versions of q
(Simpson, 1949), but
singletons are dropped and values are nonsensical if a site
contains only singletons
q.nielsen
, a better unbiased transformation of q
following Nielsen et al. (2003) that does not have the
singleton properties of r
Each such list q
, r
and q.nielsen
contains several
elements representing different diversity statistics. Several
quantities are included:
q.gg
, vector of length number of sites, containing
squared frequencies of groups in each site. In form q
,
these are untransformed, while in form r
and
q.nielsen
, these are transformed accordingly
q.bar.0
, scalar, weighted mean of q.gg
q.variance.0
, scalar, weighted sample variance of
q.bar.0
q.unweighted.mean
, mean of q.gg
alpha.g
, vector of length number of sites, containing
reciprocals of q.gg
alpha.unweighted.mean
, scalar, mean of alpha.g
d.alpha
, scalar, reciprocal of q.unweighted.mean
d.gamma
, scalar, reciprocal of sum of grand squared
frequencies
d.beta
, scalar, d.gamma / d.alpha
diversity.mat
, sites-by-sites matrix containing Chao
pairwise divergences off-diagonal, alpha.g
on-diagonal
divergence.mat
, sites-by-sites matrix matching
diversity.mat
but with with 0
on-diagonal
overlap.mat
, sites-by-sites matrix containing
1 - divergence.mat
overlap
, scalar, mean overlap,
∑{C} / ((G - 1) ∑{q_{gg}})
divergence
, scalar, mean divergence, 1 - overlap
The list also contains the original divtable
passed to
diversity
, together with several descriptive quantities:
table
, the class divtable
object passed in
as tab
num.groups
, the number of rows in tab
num.sources
, the number of columns in tab
num.samples
, the sum of all elements in tab
num.samples.group
, a vector of length num.groups
,
the sum of elements in each row of tab
num.sources.group
, a vector of length num.groups
,
the number of distinct groups observed in each row of tab
num.samples.source
, a vector of length num.sources
,
the sum of elements in each column of tab
num.groups.source
, a vector of length num.groups
,
the number of distinct groups observed in each row of tab
Finally, some additional statistics representing pooled PMI measures (Scofield et al. 2010) and weighted overlaps (Scofield et al. 2011) are returned:
y.gh
, a pairwise matrix of counts of items in each group
from any source that are shared with each other group
prop.y.0.gh
, a matrix of proportions of items in each
group from any source that are shared with each other group,
derived from y.gh
q.0.gh
, a matrix of probabilities that two items drawn
from group g and h are from any of the sources shared between
g and h
q.bar.gh
, weighted mean overlap (q_{gh}),
probabilities that two items, one drawn from each of groups
g and h, are from the same source, weighted by
sample sizes
q.variance.gh
, weighted sample variance of q.bar.gh
The value from diversityMultilocus
Simpson, E. D. (1949) Measurement of diversity. Nature 163:688.
Chao, A., Jost, L., Chiang, S. C., Jiang, Y. H., and Chazdon, R. L. (2008) A two-stage probabilistic approach to multiple-community similarity indices. Biometrics 64:1178-1186.
Grivet, D., Smouse, P. E. and Sork, V. L. (2005) A novel approach to an old problem: tracking dispersed seeds. Molecular Ecology 14:3585-3595.
Nielsen, R., Tarpy, D. R. and Reeve, H. K. (2003) Estimating effective paternity number in social insects and the effective number of alleles in a population. Molecular Ecology 12:3157-3164.
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 | ## create table of random memberships from data frame of site-source pairs
n.sites <- 5
n.sources <- 10
n.samples <- 160
set.seed(75333)
t <- data.frame(site = sample(n.sites, n.samples, replace = TRUE),
source = round(runif(n.samples) * n.sources + 0.5))
## diversity accepts table via default method, which applies as.divtable
div <- diversity(table(t))
div$q
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.