Title: | Rarefaction-Based Species Richness Estimator |
---|---|
Description: | Calculate rarefaction-based alpha- and beta-diversity. Offer parametric extrapolation to estimate the total expected species in a single community and the total expected shared species between two communities. Visualize the curve-fitting for these estimators. |
Authors: | Peng Zhao [aut, cre] , Yi Zou [aut] |
Maintainer: | Peng Zhao <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-11-08 06:51:30 UTC |
Source: | https://github.com/pzhaonet/rarestr |
Calculate the Expected Species
es(x, m, method = c("a", "b"), MARGIN = 1)
es(x, m, method = c("a", "b"), MARGIN = 1)
x |
a data vector representing number of individuals for each species |
m |
the sample size parameter that represents the number of individuals randomly drawn from the sample. For ESa, m can not be larger than the sample size |
method |
the calculation approach of Expected Species used, with two options available as "a" and "b" to calculate ESa and ESb, with the default set as "a" |
MARGIN |
a vector giving the subscripts which the function will be applied over, see 'apply'. |
a value of Expected Species
Zou Y, Zhao P, Axmacher JC (2023). “Estimating total species richness: Fitting rarefaction by asymptotic approximation.” Ecosphere, 14(1), e4363. doi:10.1002/ecs2.4363.
data(share, package = 'rarestR') rowSums(share) #The sum size of each sample is 100, 150 and 200 es(share, m = 100) es(share, method = "b", m = 100) # When the m is larger than the total sample size, "NA" will be filled: es(share, m = 150)
data(share, package = 'rarestR') rowSums(share) #The sum size of each sample is 100, 150 and 200 es(share, m = 100) es(share, method = "b", m = 100) # When the m is larger than the total sample size, "NA" will be filled: es(share, m = 150)
Compute dissimilarity estimates between two samples based on Expected Species Shared (ESS)-measures, using abundance data for the species contained in each samples
ess(x, m = 1, index = "CNESSa")
ess(x, m = 1, index = "CNESSa")
x |
a community data matrix (sample x species); sample name is the row name of the matrix |
m |
the sample size parameter that represents the number of individuals randomly drawn from each sample, which by default is set to m=1, but can be changed according to the users' requirements. Rows with a total sample size <m will be excluded automatically from the analysis. |
index |
the distance measure used in the calculation, as one of the four options "CNESSa", "CNESS","NESS" and "ESS", with the default set as "CNESSa" |
a pair-wised matrix
Zou Y, Axmacher JC (2020). “The Chord-Normalized Expected Species Shared (CNESS)-distance represents a superior measure of species turnover patterns.” Methods in Ecology and Evolution, 11(2), 273-280. doi:10.1111/2041-210X.13333.
data(share, package = 'rarestR') ess(share) ess(share, m = 100) ess(share, m = 100, index = "ESS")
data(share, package = 'rarestR') ess(share) ess(share, m = 100) ess(share, m = 100, index = "ESS")
Plot fitted curve for TES
plot_tes(TES_output, ...)
plot_tes(TES_output, ...)
TES_output |
the output from tes() |
... |
other arguments passed to plot() |
a plot
Plot fitted curve for TESS
plot_tess(TESS_output, ...)
plot_tess(TESS_output, ...)
TESS_output |
the output from tess() |
... |
other arguments passed to plot() |
a plot
Plot the "rarestr" class
## S3 method for class 'rarestr' plot(x, ...)
## S3 method for class 'rarestr' plot(x, ...)
x |
a "rarestr" object |
... |
other arguments passed to plot() |
Plot the "rarestr" class
data(share, package = 'rarestR') Output_tes <- tes(share[1,]) Output_tes plot(Output_tes)
data(share, package = 'rarestR') Output_tes <- tes(share[1,]) Output_tes plot(Output_tes)
This function prints the contents of a rarestr object.
## S3 method for class 'rarestr' print(x, ...)
## S3 method for class 'rarestr' print(x, ...)
x |
a "rarestr" object#' |
... |
Other arguments passed to print(). |
Print the "rarestr" class
data(share, package = 'rarestR') Output_tes <- tes(share[1,]) Output_tes
data(share, package = 'rarestR') Output_tes <- tes(share[1,]) Output_tes
Calculation of Total Expected Species base on ESa, ESb and their average value
tes(x)
tes(x)
x |
a data vector representing number of individuals for each species |
The value returned by the tes()
function in the 'rarestr' class is a list containing three parts:
A data frame of the summary of the estimated values and their standard deviations based on TESa, TESb, and TESab, and the model used in the estimation of TES, either 'logistic' or 'Weibull'.
A list of the modeled results with the TESa method.
A list of the modeled results with the TESb method.
Both TESa and TESb contain five parts, including a data frame of the parameters ($par
), a data frame of the simulated results ($result
), a maximum x value ($xmax
), a vector of the predicted x value ($Predx
), and a vector of the predicted y value ($Predy
)
a list in a self-defined class 'rarestr'. See "Details".
Zou Y, Zhao P, Axmacher JC (2023). “Estimating total species richness: Fitting rarefaction by asymptotic approximation.” Ecosphere, 14(1), e4363. doi:10.1002/ecs2.4363.
data(share, package = 'rarestR') Output_tes <- tes(share[1,]) Output_tes
data(share, package = 'rarestR') Output_tes <- tes(share[1,]) Output_tes
Calculate the Total number of Expected Shared Species between two samples.
tess(x)
tess(x)
x |
a data matrix for two samples representing two communities (plot x species) |
The value returned by the tess()
function in the 'rarestr' class is a list containing five parts:
A data frame of the summary of the estimated values and their standard deviations based on TESa, TESb, and TESab, and the model used in the estimation of TES, either 'logistic' or 'Weibull'.
A data frame of the simulated results.
A maximum x value.
A vector of the predicted x value.
A vector of the predicted y value.
a list in a self-defined class 'rarestr'. See "Details".
Zou Y, Axmacher JC (2021). “Estimating the number of species shared by incompletely sampled communities.” Ecography, 44(7), 1098-1108. doi:10.1111/ecog.05625.
data(share, package = 'rarestR') Output_tess <- tess(share[1:2,]) Output_tess
data(share, package = 'rarestR') Output_tess <- tess(share[1:2,]) Output_tess