rare_alpha | R Documentation |
The function calculates spatial and non-spatially explicit rarefaction curves using different indexes of species alpha diversity.
rare_alpha(comm,dist_xy=NULL,method=c("HCDT","hill","fun_div"),q=0,random=99,fun_div=NULL
,args=NULL,verbose=FALSE,spatial=FALSE,mean=FALSE)
comm |
a community data frame or matrix with N plots as rows, S species as columns. Both the presence/absence (1/0) or the abundances of species in plots are allowed as entries. Plot names should be provided as row names. |
dist_xy |
an object of class |
method |
the diversity index for the calculation of the rarefaction curve, one among "HCDT","hill" or "fun_div". See details. |
q |
parameter that determines the sensitivity of the measure to the relative abundance of the species (ignored if method = fun_div). |
random |
number of iterations to construct the non-spatially explicit rarefaction curve |
fun_div |
a string with the name of the user-defined function for the diversity index in the rarefaction. The function must calculate the value of the chosen diversity index per plot and return a numeric vector with the values calculated. |
args |
a list with the arguments for fun_div. The value NA should be given in place of the community matrix in the list. The names of the elements must correspond to the names of the arguments of the function passed. |
verbose |
if TRUE, the arguments of |
spatial |
if TRUE, the function calculates the spatially-explicit rarefaction. |
mean |
if TRUE, the mean of the relative abundances of the species in all the sampling dimensions is used for the calculation of the rarefaction instead of the total abundance, giving less importance to abundant species. |
The available methods are:
HCDT
: HCDT entropy is a generalization of the standard coefficient of entropy (Harvda and Charvat 1967; Daroczy 1970; Tsallis 1988):
HCDT=\frac{1-\left(\sum_{i}^{S}(p_i)^q \right )}{q-1}
where S
is the number of species, p_i
is the relative abundance of species i
and q
is the parameter that regulates the sensitivity to species abundance. When q
tends to 1, the equation becomes the Shannon entropy:
HCDT=-\sum_{i=1}^{S}p_ilog(p_i)
hill
: Hill numbers (^qD
) is a class of measures that obeys to the replication principle and integrates species richness and species abundances. The parameter q
, called 'order', regulates the sensitivity of the index to the species abundance: with q=0
the value of the index correspond to the species richness, with q=1
the measure tends to the exponential of Shannon index, and with q=2
it corresponds to the inverse of Simpson index:
^{q}\textrm{D}=\left( \sum_{i=1}^{S}p_i^q\right )^{1/(1-q)}
where S
is the number of species, p_i
is the relative abundance of species i
and q is the order.
hill
doesn't behave like a non-decreasing function of the increasing number of plots N. This behavior is typical of non-concave indexes.
An object of class data.frame
with 3 columns is returned:
- Rarefaction: mean of the values of the accumulation curves for all the sampling dimensions;
- IC_up: upper confidence interval;
- IC_low: lower confidence interval.
Elisa Thouverai elisa.th95@gmail.com
with contributions of Sandrine Pavoine.
Chao, A., Gotelli, N. J., Hsieh, T. C., Sander, E. L., Ma, K. H., Colwell, R. K., Ellison, A. M (2014). Rarefaction and extrapolation with Hill numbers: A framework for sampling and estimation in species diversity studies. Ecological Monographs, 84, 45–67.
Daroczy, Z. (1970) Generalized information functions. Information and Control, 16, 36–51.
Havrda, M., Charvat F. (1967) Quantification method of classification processes: concept of structural alpha-entropy. Kybernetik, 3, 30–35.
Ricotta, C., Pavoine, S., Bacaro, G., Acosta, A. (2012) Functional rarefaction for species abundance data. Methods in Ecology and Evolution, 3, 519–525.
Tsallis, C. (1988) Possible generalization of Boltzmann-Gibbs statistics. Journal of Statistical Physics, 52, 480–487.
## Not run:
#Time consuming
require(adiv)
data(duneFVG)
data(duneFVG.xy)
dist_sp<-dist(duneFVG.xy$tot.xy,'euclidean')
## Spatial explicit rarefaction with HCDT
rare<-rare_alpha(duneFVG$total,dist_sp,q=2,random=99,spatial=TRUE)
## Non-spatially explicit rarefaction with Hill
rare1<-rare_alpha(duneFVG$total,dist_sp,method='hill',q=2,mean=TRUE)
##fun_div with the list of arguments passed
#to set the argument, digit the correspondent number
#digit the number correspondent to "stop" when the process is complete
#remember to load the package that contain the function you want to exploit
#Example with the function speciesdiv() of adiv package
a<-list(NA,'Shannon')
names(a)<-c('comm','method')
rare2<-rare_alpha(duneFVG$total,method="fun_div",random=999,fun_div='speciesdiv',args=a,mean
=TRUE)
rare3<-rare_alpha(duneFVG$total,dist_sp,method="fun_div",fun_div='speciesdiv',args=a,spatial
=TRUE,mean=TRUE)
##fun_div without the list of arguments passed (verbose=TRUE)
rare4<-rare_alpha(duneFVG$total,method="fun_div",random=999,fun_div='speciesdiv',verbose=TRUE,mean
=TRUE)
rare5<-rare_alpha(duneFVG$total,dist_sp,method="fun_div",fun_div='speciesdiv',verbose=TRUE,spatial
=TRUE,mean=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.