View source: R/ser_functional.R
ser_functional | R Documentation |
The function calculates classic and spatially-explicit rarefaction curves using different indexes of functional diversity.
ser_functional(comm,dist_f=NULL,dist_xy,method=c("rao","chao","fun_div"),
tau=NA,q=0,comparison=FALSE,resampling=99,fun_div=NULL,args=NULL,verbose=FALSE)
comm |
a community dataframe or matrix with N plots as rows, S species as columns. Only the abundances of species in plots are allowed as entries for the methods |
dist_f |
an object of class |
dist_xy |
an object of class |
method |
the diversity index for the calculation of the rarefaction curve, one among "rao", "chao" or "fun_div". See details. |
tau |
threshold of functional distinctiveness between any two species for |
q |
parameter that determines the sensitivity of the measure to the relative abundance of the species for |
comparison |
if TRUE, both non-spatially explicit and spatially explicit rarefactions are calculated. |
resampling |
number of times plots (rows) are randomly resampled from comm to calculate the mean accumulation curve for the non-spatially-explicit rarefaction. |
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 |
The available methods are:
rao
: Rao functional diversity is based on the quadratic entropy of Rao (1982) and incorporates both the relative abundances of species and a measure of the pairwise functional distances between species. It expresses the average difference between two randomly selected individuals with replacements.
Q(\mathbf{p}_i,\mathbf{D})=\sum_{k=1}^S\sum_{l=1}^S p_{k}p_{l}d_{kl}
where p=(p1,...,p_k,...,S)
is the vector of relative species abundances, S
is the number of species, \mathbf{D}=(d_{kl})
is the matrix of functional dissimilarities among species, and d_{kl}
is the functional dissimilarity between species k
and l
.
chao
: Chao et al. (2018) functional beta-diversity index FD quantifies the effective number of equally-distinct functional groups in the considered plots at the distinctiveness tau
threshold. Any two species with functional distance greater than or equal to tau
, are treated as functionally equally-distinct and as belonging to different functional groups with distance tau
. For each pair of species with functional distance lower than tau
but different from zero, only a proportion of individuals is considered functionally equally-distinct, the other proportion of individuals is considered functionally indistinct. If the pairwise distance is equal to zero, the two species are treated as belonging to the same functional group. After dividing the set of species to form functionally indistinct groups, the contribution of every species is quantified and then the FD of order q is calculated using the Hill number of order q
:
^{q}\textrm{FD}(\Delta(\tau))=\left ( \sum_{i=1}^{S} \nu_{i}(\tau)\left(\frac{a_i(\tau)}{n_{+}} \right )^{(1/1-q)} \right )
where a_{i}(\tau)
is the combined abundance of all functionally-indistinct individuals from species i
, v_{i}(\tau)=n_{i}/a_{i}(\tau)
represents the attribute contribution of species i
for a threshold level tau
(n_{i}
is the abundance of species i
), n_+
is the total number of individuals in the community and q
is the parameter that determines the sensitivity of the measure to the relative abundance of the species.
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.
Botta-Dukat, Z. (2005) Rao's quadratic entropy as a measure of functional diversity based on multiple traits. Journal of Vegetation Science, 16, 533–540.
Chao, A., Chiu, C.-H., Villeger, S., Sun, I.F., Thorn, S., Lin, Y., Chiang, J.-M., B. Sherwin, W. (2018) An attribute-diversity approach to functional diversity, functional beta diversity, and related (dis)similarity measures. Ecological Monographs, 89, e01343.
Rao, C.R. (1982) Diversity and dissimilarity coefficients: a unified approach. Theoretical Population Biology, 21, 24–43.
Ricotta, C., Pavoine, S., Bacaro, G., Acosta, A. (2012) Functional rarefaction for species abundance data. Methods in Ecology and Evolution, 3, 519–525.
rare_Rao
rare_alpha
## Not run:
#Time consuming
require(ade4)
data(duneFVG)
data(duneFVG.xy)
data(duneFVG.tr8)
tr8_N<-duneFVG.tr8$traits.tot[,c(1,3,4)]
tr8_D<-data.frame(duneFVG.tr8$traits.tot[,2])
tr8_Q<-duneFVG.tr8$traits.tot[,5:15]
tr8dist<-dist.ktab(ktab.list.df(list(tr8_N,tr8_D,tr8_Q)),type=c('N','D','Q'))
tr8dist<-cailliez(tr8dist)
dist_sp<-dist(duneFVG.xy$tot.xy,'euclidean')
## Rao index
## Take care that the following scripts may be time-consuming
rare<-ser_functional(duneFVG$total,tr8dist,dist_sp,method='rao',comparison=TRUE)
plot(rare [,1], ylab="Rao QE", xlab="Number of plots", type="l", ylim=range(rare, na.rm=TRUE))
lines(rare[,2], lty=2)
lines(rare[,3], lty=2)
lines(rare[,4 ], col=2)
lines(rare[,5], lty=2, col=2)
lines(rare[,6], lty=2, col=2)
legend("bottomright", legend=c("spatially-explicit rarefaction", "classic rarefaction"),
lty=1, col=1:2)
# dashed lines represent the confidence interval
## Chao index
rareC<-ser_functional(duneFVG$total,tr8dist,dist_sp,method='chao',tau=0.6,q=2,comparison
=TRUE)
plot(rareC [,1], ylab="Chao", xlab="Number of plots", type="l", ylim=range(rareC, na.rm
=TRUE))
lines(rareC[,2], lty=2)
lines(rareC[,3], lty=2)
lines(rareC[,4 ], col=2)
lines(rareC[,5], lty=2, col=2)
lines(rareC[,6], lty=2, col=2)
legend("bottomright", legend=c("spatially-explicit rarefaction", "classic rarefaction"),
lty=1, col=1:2)
# dashed lines represent the confidence interval
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.