iNEXT.3D
(INterpolation and EXTrapolation for three dimensions of biodiversity)
is a sequel to iNEXT
(Hsieh et al., 2016). Here the three dimensions (3D) of diversity
include taxonomic diversity (TD), phylogenetic diversity (PD) and
functional diversity (FD). An online version “iNEXT.3D Online” (https://chao.shinyapps.io/iNEXT_3D/) is also available
for users without an R background.
A unified framework based on Hill numbers (for TD) and their
generalizations (Hill-Chao numbers, for PD and FD) is adopted to
quantify 3D. In this framework, TD quantifies the effective number of
species, PD quantifies the effective total branch length, mean-PD (PD
divided by tree depth) quantifies the effective number of lineages, and
FD quantifies the effective number of virtual functional groups (or
functional “species”). Thus, TD, mean-PD, and FD are all in the same
units of species/lineage equivalents and can be meaningfully compared;
see Chao et al. (2014) for the basic standardization theory for TD, and
Chao et al. (2021) for a review of the unified theory for 3D.
For each of the three dimensions of biodiversity,
iNEXT.3D
features two statistical analyses (non-asymptotic
and asymptotic):
- A non-asymptotic approach based on interpolation and extrapolation
for 3D diversity (i.e., Hill-Chao numbers)
iNEXT.3D
computes the estimated 3D diversity for
standardized samples with a common sample size or sample completeness.
This approach aims to compare diversity estimates for equally-large
(with a common sample size) or equally-complete (with a common sample
coverage) samples; it is based on the seamless rarefaction and
extrapolation (R/E) sampling curves of Hill-Chao numbers for q = 0, 1
and 2. For each dimension of biodiversity, iNEXT.3D
offers
three types of R/E sampling curves:
Sample-size-based (or size-based) R/E sampling curves: This type
of sampling curve plots the diversity estimates with respect to sample
size.
Coverage-based R/E sampling curves: This type of sampling curve
plots the diversity estimates with respect to sample coverage.
Sample completeness curve: This curve depicts how sample coverage
varies with sample size. The sample completeness curve provides a bridge
between the size- and coverage-based R/E sampling curves.
- An asymptotic approach to infer asymptotic 3D diversity (i.e.,
Hill-Chao numbers)
iNEXT.3D
computes the estimated asymptotic 3D diversity
and also plots 3D diversity profiles (q-profiles) for q between 0 and 2,
in comparison with the observed diversity. Typically, the asymptotic
estimates for q ≥ 1 are reliable, but
for q < 1 (especially for q = 0, species richness), the asymptotic
estimates represent only lower bounds. iNEXT.3D
also
features a time-profile (which depicts the observed and asymptotic
estimate of PD or mean PD with respect to reference times), and a
tau-profile (which depicts the observed and asymptotic estimate of FD
with respect to threshold level tau).
How to cite
If you publish your work based on results from iNEXT.3D
package, you should make references to the following methodology paper
and the package:
Chao, A., Henderson, P. A., Chiu, C.-H., Moyes, F., Hu, K-H.,
Dornelas, M and. Magurran, A. E. (2021). Measuring temporal change in
alpha diversity: a framework integrating taxonomic, phylogenetic and
functional diversity and the iNEXT.3D standardization. Methods in
Ecology and Evolution, 12, 1926-1940.
Chao, A. and Hu, K.-H. (2023). The iNEXT.3D package:
interpolation and extrapolation for three dimensions of biodiversity. R
package available from CRAN.
SOFTWARE NEEDED TO RUN iNEXT.3D IN R
HOW TO RUN iNEXT.3D:
The iNEXT.3D
package can be downloaded from CRAN or Anne
Chao’s iNEXT.3D_github using
the commands below. For a first-time installation, some additional
packages must be installed and loaded; see package manual.
## install iNEXT.3D package from CRAN
install.packages("iNEXT.3D")
## or install the latest version from github
install.packages('devtools')
library(devtools)
install_github('AnneChao/iNEXT.3D')
## import packages
library(iNEXT.3D)
There are six main functions in this package:
Two functions for non-asymptotic analysis with graphical
displays:
iNEXT3D computes standardized 3D diversity
estimates of order q = 0, 1 and 2 for rarefied and extrapolated samples
at specified sample coverage values and sample sizes.
ggiNEXT3D visualizes the output from the
function iNEXT3D
.
Two functions for point estimation and basic data information
estimate3D computes 3D diversity of order q = 0,
1 and 2 with a particular set of user-specified level of sample sizes or
sample coverage values.
DataInfo3D provides basic data information based
on the observed data.
Two functions for asymptotic analysis with graphical displays:
ObsAsy3D computes observed and asymptotic
diversity of order q between 0 and 2 (in increments of 0.2) for 3D
diversity; it also computes observed and asymptotic PD for specified
reference times, and observed and asymptotic FD for specified threshold
levels.
ggObsAsy3D visualizes the output from the
function ObsAsy3D
.
MAIN FUNCTION iNEXT3D():
RAREFACTION/EXTRAPOLATION
We first describe the main function iNEXT3D()
with
default arguments:
iNEXT3D(data, diversity = 'TD', q = c(0,1,2), datatype = "abundance",
size = NULL, endpoint = NULL, knots = 40, nboot = 50, conf = 0.95, nT = NULL,
PDtree = NULL, PDreftime = NULL, PDtype = 'meanPD',
FDdistM, FDtype = 'AUC', FDtau = NULL, FDcut_number = 50)
The arguments of this function are briefly described below, and will
be explained in more details by illustrative examples in later text.
This main function computes standardized 3D diversity estimates of order
q = 0, 1 and 2, the sample coverage estimates, and related statistics
for K (if knots = K
in the specified argument)
evenly-spaced knots (sample sizes) between size 1 and the
endpoint
, where the endpoint is described below. Each knot
represents a particular sample size for which 3D diversity estimates
will be calculated. By default, endpoint
= double the
reference sample size for abundance data or double the total sampling
units for incidence data. For example, if endpoint = 10
,
knot = 4
is specified, diversity estimates will be computed
for a sequence of samples with sizes (1, 4, 7, 10).
data
|
- For
datatype = “abundance” , data can be input as a
vector of species abundances (for a single assemblage),
matrix/data.frame (species by assemblages), or a list of species
abundance vectors.
- For
datatype = “incidence_raw” , data can be input as a
list of matrices/data.frames (species by sampling units); data can also
be input as a single matrix/data.frame by merging all sampling units
across assemblages based on species identity; in this case, the number
of sampling units (nT, see below) must be specified.
|
diversity
|
selection of diversity type: ‘TD’ = Taxonomic diversity,
‘PD’ = Phylogenetic diversity, and ‘FD’ =
Functional diversity.
|
q
|
a numerical vector specifying the diversity orders. Default is
c(0, 1, 2) .
|
datatype
|
data type of input data: individual-based abundance data (datatype
= “abundance” ), or species by sampling-units incidence/occurrence
matrix (datatype = “incidence_raw” ) with all entries being
0 (non-detection) or 1 (detection).
|
size
|
an integer vector of sample sizes (number of individuals or sampling
units) for which diversity estimates will be computed. If
NULL , then diversity estimates will be computed for those
sample sizes determined by the specified/default endpoint
and knots .
|
endpoint
|
an integer specifying the sample size that is the endpoint
for rarefaction/extrapolation. If NULL, then endpoint
= double the reference sample size.
|
knots
|
an integer specifying the number of equally-spaced knots
(say K, default is 40) between size 1 and the endpoint ;
each knot represents a particular sample size for which diversity
estimate will be calculated. If the endpoint is smaller
than the reference sample size, then iNEXT3D() computes
only the rarefaction estimates for approximately K evenly spaced
knots . If the endpoint is larger than the
reference sample size, then iNEXT3D() computes rarefaction
estimates for approximately K/2 evenly spaced knots between
sample size 1 and the reference sample size, and computes extrapolation
estimates for approximately K/2 evenly spaced knots between
the reference sample size and the endpoint .
|
nboot
|
a positive integer specifying the number of bootstrap replications when
assessing sampling uncertainty and constructing confidence intervals.
Enter 0 to skip the bootstrap procedures. Default is 50.
|
conf
|
a positive number < 1 specifying the level of confidence interval.
Default is 0.95.
|
nT
|
(required only when datatype = “incidence_raw” and input
data in a single matrix/data.frame) a vector of nonnegative integers
specifying the number of sampling units in each assemblage. If
assemblage names are not specified(i.e., names(nT) = NULL ),
then assemblages are automatically named as “assemblage1”,
“assemblage2”,…, etc.
|
PDtree
|
(required argument for diversity = “PD” ), a phylogenetic
tree in Newick format for all observed species in the pooled assemblage.
|
PDreftime
|
(argument only for diversity = “PD” ), a vector of numerical
values specifying reference times for PD. Default is NULL
(i.e., the age of the root of PDtree).
|
PDtype
|
(argument only for diversity = “PD” ), select PD type:
PDtype = “PD” (effective total branch length) or
PDtype = “meanPD” (effective number of equally divergent
lineages). Default is “meanPD” , where meanPD =
PD/tree depth .
|
FDdistM
|
(required argument for diversity = “FD” ), a species
pairwise distance matrix for all species in the pooled assemblage.
|
FDtype
|
(argument only for diversity = “FD” ), select FD type:
FDtype = “tau_values” for FD under specified threshold
values, or FDtype = “AUC” (area under the curve of
tau-profile) for an overall FD which integrates all threshold values
between zero and one. Default is “AUC” .
|
FDtau
|
(argument only for diversity = “FD” and FDtype =
“tau_values” ), a numerical vector between 0 and 1 specifying tau
values (threshold levels). If NULL (default), then
threshold is set to be the mean distance between any two individuals
randomly selected from the pooled assemblage (i.e., quadratic entropy).
|
FDcut_number
|
(argument only for diversity = “FD” and FDtype =
“AUC” ), a numeric number to cut [0, 1] interval into equal-spaced
sub-intervals to obtain the AUC value by integrating the tau-profile.
Equivalently, the number of tau values that will be considered to
compute the integrated AUC value. Default is FDcut_number =
50 . A larger value can be set to obtain more accurate AUC value.
|
For each dimension of diversity (TD
, PD
,
FD
), the main function iNEXT3D()
returns the
iNEXT3D
object, which can be further used to make plots
using the function ggiNEXT3D()
to be described below. The
"iNEXT3D"
object includes three lists:
$TDInfo
($PDInfo
,or
$FDInfo
) for summarizing data information.
$TDiNextEst
($PDiNextEst
, or
$FDiNextEst
) for showing diversity estimates along with
related statistics for a series of rarefied and extrapolated samples;
there are two data frames ($size_based
and
$coverage_based
) conditioning on standardized sample size
or sample coverage, respectively.
$TDAsyEst
($PDAsyEst
, or
$FDAsyEst
) for showing asymptotic diversity estimates along
with related statistics.
FUNCTION ggiNEXT3D(): GRAPHIC
DISPLAYS
The function ggiNEXT3D()
, which extends
ggplot2
with default arguments, is described as
follows:
ggiNEXT3D(output, type = 1:3, facet.var = "Assemblage", color.var = "Order.q")
Here output
is the iNEXT3D()
object. Three
types of curves are allowed for 3D diversity:
Sample-size-based R/E curve (type = 1
): This curve
plots diversity estimates with confidence intervals as a function of
sample size.
Sample completeness curve (type = 2
): This curve
plots the sample coverage with respect to sample size.
Coverage-based R/E curve (type = 3
): This curve
plots the diversity estimates with confidence intervals as a function of
sample coverage.
The argument facet.var = "Order.q"
,
facet.var = "Assemblage"
, facet.var = "Both"
,
or facet.var = "None"
is used to create a separate plot for
each value of the specified variable.
The ggiNEXT3D()
function is a wrapper with the package
ggplot2
to create a rarefaction/extrapolation sampling
curve in a single line of code. The figure object is of class
"ggplot"
, so it can be manipulated by using the
ggplot2
tools.
FUNCTION estimate3D(): POINT
ESTIMATION
estimate3D
is used to compute 3D diversity (TD, PD, FD)
estimates with q = 0, 1, 2 under any specified levels of sample size
(when base = "size"
) and sample coverage values (when
base = "coverage"
) for abundance data
(datatype = "abundance"
) or incidence data
(datatype = "incidence_raw"
). When
base = "size"
, level
can be specified with a
particular vector of sample sizes (greater than 0); if
level = NULL
, this function computes the diversity
estimates for the minimum sample size among all samples extrapolated to
the double reference sizes. When base = "coverage"
,
level
can be specified with a particular vector of sample
coverage values (between 0 and 1); if level = NULL
, this
function computes the diversity estimates for the minimum sample
coverage among all samples extrapolated to the double reference sizes.
All arguments in the function are the same as those for the main
function iNEXT3D
.
estimate3D(data, diversity = "TD", q = c(0, 1, 2), datatype = "abundance",
base = "coverage", level = NULL, nboot = 50, conf = 0.95,
nT = NULL, PDtree, PDreftime = NULL, PDtype = "meanPD",
FDdistM, FDtype = "AUC", FDtau = NULL, FDcut_number = 50)
TAXONOMIC DIVERSITY (TD): point
estimation
Example 7a: TD for abundance data with two target coverage values
(93% and 97%)
The following commands return the TD estimates with two specified
levels of sample coverage (93% and 97%) based on the
Brazil_rainforest_abun_data
.
data(Brazil_rainforest_abun_data)
output_est_TD_abun <- estimate3D(Brazil_rainforest_abun_data, diversity = 'TD', q = c(0,1,2),
datatype = "abundance", base = "coverage", level = c(0.93, 0.97))
output_est_TD_abun
Assemblage Order.q SC m Method qTD s.e. qTD.LCL qTD.UCL
1 Edge 0 0.93 1547.562 Rarefaction 302.879 13.192 277.023 328.735
2 Edge 0 0.97 3261.971 Extrapolation 383.307 19.554 344.983 421.632
3 Edge 1 0.93 1547.562 Rarefaction 152.374 5.021 142.533 162.215
4 Edge 1 0.97 3261.971 Extrapolation 166.837 5.724 155.618 178.056
5 Edge 2 0.93 1547.562 Rarefaction 81.437 3.942 73.711 89.163
6 Edge 2 0.97 3261.971 Extrapolation 83.726 4.196 75.502 91.950
7 Interior 0 0.93 1699.021 Rarefaction 331.917 13.002 306.435 357.400
8 Interior 0 0.97 3883.447 Extrapolation 433.807 22.707 389.303 478.311
9 Interior 1 0.93 1699.021 Rarefaction 159.330 5.573 148.408 170.253
10 Interior 1 0.97 3883.447 Extrapolation 175.739 6.077 163.829 187.650
11 Interior 2 0.93 1699.021 Rarefaction 71.611 4.210 63.359 79.862
12 Interior 2 0.97 3883.447 Extrapolation 73.326 4.386 64.730 81.921
Example 7b: TD for incidence data with two target coverage values
(97.5% and 99%)
The following commands return the TD estimates with two specified
levels of sample coverage (97.5% and 99%) for the
Fish_incidence_data
.
data(Fish_incidence_data)
output_est_TD_inci <- estimate3D(Fish_incidence_data, diversity = 'TD', q = c(0, 1, 2),
datatype = "incidence_raw", base = "coverage",
level = c(0.975, 0.99))
output_est_TD_inci
Assemblage Order.q SC mT Method qTD s.e. qTD.LCL qTD.UCL
1 2013-2015 0 0.975 29.169 Rarefaction 47.703 3.128 41.573 53.834
2 2013-2015 0 0.990 58.667 Extrapolation 54.914 8.422 38.407 71.421
3 2013-2015 1 0.975 29.169 Rarefaction 29.773 0.929 27.953 31.592
4 2013-2015 1 0.990 58.667 Extrapolation 30.751 1.019 28.753 32.748
5 2013-2015 2 0.975 29.169 Rarefaction 23.861 0.693 22.504 25.219
6 2013-2015 2 0.990 58.667 Extrapolation 24.126 0.721 22.713 25.540
7 2016-2018 0 0.975 34.825 Rarefaction 52.574 8.444 36.025 69.124
8 2016-2018 0 0.990 76.971 Extrapolation 62.688 17.236 28.906 96.470
9 2016-2018 1 0.975 34.825 Rarefaction 31.479 1.158 29.210 33.747
10 2016-2018 1 0.990 76.971 Extrapolation 32.721 1.205 30.360 35.083
11 2016-2018 2 0.975 34.825 Rarefaction 24.872 0.761 23.380 26.363
12 2016-2018 2 0.990 76.971 Extrapolation 25.163 0.778 23.638 26.688
PHYLOGENETIC DIVERSITY (PD): point
estimation
Example 8a: PD for abundance data with two target sample sizes (1500
and 3500)
The following commands return the PD estimates with two specified
levels of sample sizes (1500 and 3500) for the
Brazil_rainforest_abun_data
.
data(Brazil_rainforest_abun_data)
data(Brazil_rainforest_phylo_tree)
data <- Brazil_rainforest_abun_data
tree <- Brazil_rainforest_phylo_tree
output_est_PD_abun <- estimate3D(data, diversity = 'PD', datatype = "abundance",
base = "size", level = c(1500, 3500), PDtree = tree)
output_est_PD_abun
Assemblage Order.q m Method SC qPD s.e. qPD.LCL qPD.UCL Reftime Type
1 Edge 0 1500 Rarefaction 0.928 58.370 1.284 55.854 60.886 400 meanPD
2 Edge 0 3500 Extrapolation 0.973 71.893 2.269 67.446 76.339 400 meanPD
3 Edge 1 1500 Rarefaction 0.928 5.224 0.111 5.006 5.441 400 meanPD
4 Edge 1 3500 Extrapolation 0.973 5.320 0.113 5.099 5.541 400 meanPD
5 Edge 2 1500 Rarefaction 0.928 1.797 0.028 1.742 1.851 400 meanPD
6 Edge 2 3500 Extrapolation 0.973 1.797 0.028 1.742 1.852 400 meanPD
7 Interior 0 1500 Rarefaction 0.922 63.555 1.221 61.163 65.948 400 meanPD
8 Interior 0 3500 Extrapolation 0.965 78.004 2.256 73.582 82.426 400 meanPD
9 Interior 1 1500 Rarefaction 0.922 5.675 0.114 5.452 5.898 400 meanPD
10 Interior 1 3500 Extrapolation 0.965 5.784 0.116 5.557 6.012 400 meanPD
11 Interior 2 1500 Rarefaction 0.922 1.913 0.034 1.847 1.980 400 meanPD
12 Interior 2 3500 Extrapolation 0.965 1.914 0.034 1.847 1.981 400 meanPD
Example 8b: PD for incidence data with two target coverage values
(97.5% and 99%)
The following commands return the PD estimates with two specified
levels of sample coverage (97.5% and 99%) for the
Fish_incidence_data
.
data(Fish_incidence_data)
data(Fish_phylo_tree)
data <- Fish_incidence_data
tree <- Fish_phylo_tree
output_est_PD_inci <- estimate3D(data, diversity = 'PD', datatype = "incidence_raw",
base = "coverage", level = c(0.975, 0.99), PDtree = tree)
output_est_PD_inci
Assemblage Order.q SC mT Method qPD s.e. qPD.LCL qPD.UCL Reftime Type
1 2013-2015 0 0.975 29.169 Rarefaction 9.672 0.355 8.976 10.369 0.9770115 meanPD
2 2013-2015 0 0.990 58.667 Extrapolation 10.018 0.513 9.013 11.023 0.9770115 meanPD
3 2013-2015 1 0.975 29.169 Rarefaction 7.612 0.134 7.349 7.876 0.9770115 meanPD
4 2013-2015 1 0.990 58.667 Extrapolation 7.680 0.131 7.423 7.937 0.9770115 meanPD
5 2013-2015 2 0.975 29.169 Rarefaction 7.003 0.135 6.739 7.266 0.9770115 meanPD
6 2013-2015 2 0.990 58.667 Extrapolation 7.030 0.133 6.770 7.291 0.9770115 meanPD
7 2016-2018 0 0.975 34.825 Rarefaction 9.646 0.492 8.682 10.611 0.9770115 meanPD
8 2016-2018 0 0.990 76.971 Extrapolation 9.831 0.724 8.412 11.250 0.9770115 meanPD
9 2016-2018 1 0.975 34.825 Rarefaction 7.779 0.126 7.531 8.026 0.9770115 meanPD
10 2016-2018 1 0.990 76.971 Extrapolation 7.835 0.128 7.585 8.085 0.9770115 meanPD
11 2016-2018 2 0.975 34.825 Rarefaction 7.201 0.123 6.959 7.442 0.9770115 meanPD
12 2016-2018 2 0.990 76.971 Extrapolation 7.224 0.122 6.984 7.464 0.9770115 meanPD
FUNCTIONAL DIVERSITY (FD): point
estimation
Example 9a: FD for abundance data with two target coverage values
(93% and 97%)
The following commands return the FD estimates with two specified
levels of sample coverage (93% and 97%) for the
Brazil_rainforest_abun_data
.
data(Brazil_rainforest_abun_data)
data(Brazil_rainforest_distance_matrix)
data <- Brazil_rainforest_abun_data
distM <- Brazil_rainforest_distance_matrix
output_est_FD_abun <- estimate3D(data, diversity = 'FD', datatype = "abundance",
base = "coverage", level = c(0.93, 0.97), nboot = 10,
FDdistM = distM, FDtype = 'AUC')
output_est_FD_abun
Assemblage Order.q SC m Method qFD s.e. qFD.LCL qFD.UCL
1 Edge 0 0.93 1547.562 Rarefaction 17.590 2.119 13.437 21.743
2 Edge 0 0.97 3261.971 Extrapolation 18.578 2.917 12.861 24.295
3 Edge 1 0.93 1547.562 Rarefaction 11.732 0.334 11.078 12.386
4 Edge 1 0.97 3261.971 Extrapolation 11.932 0.355 11.236 12.628
5 Edge 2 0.93 1547.562 Rarefaction 9.120 0.287 8.558 9.683
6 Edge 2 0.97 3261.971 Extrapolation 9.190 0.295 8.611 9.769
7 Interior 0 0.93 1699.021 Rarefaction 16.890 2.258 12.464 21.316
8 Interior 0 0.97 3883.447 Extrapolation 17.839 3.527 10.925 24.752
9 Interior 1 0.93 1699.021 Rarefaction 9.668 0.217 9.242 10.094
10 Interior 1 0.97 3883.447 Extrapolation 9.841 0.227 9.397 10.286
11 Interior 2 0.93 1699.021 Rarefaction 6.994 0.139 6.722 7.267
12 Interior 2 0.97 3883.447 Extrapolation 7.035 0.141 6.758 7.311
Example 9b: FD for incidence data with two target number of sampling
units (30 and 70)
The following commands return the FD estimates with two specified
levels of sample sizes (30 and 70) for the
Fish_incidence_data
.
data(Fish_incidence_data)
data(Fish_distance_matrix)
data <- Fish_incidence_data
distM <- Fish_distance_matrix
output_est_FD_inci <- estimate3D(data, diversity = 'FD', datatype = "incidence_raw",
base = "size", level = c(30, 70), nboot = 10,
FDdistM = distM, FDtype = 'AUC')
output_est_FD_inci
Assemblage Order.q mT Method SC qFD s.e. qFD.LCL qFD.UCL
1 2013-2015 0 30 Rarefaction 0.976 17.748 0.339 17.084 18.411
2 2013-2015 0 70 Extrapolation 0.993 18.558 0.636 17.312 19.804
3 2013-2015 1 30 Rarefaction 0.976 15.929 0.344 15.256 16.603
4 2013-2015 1 70 Extrapolation 0.993 16.006 0.330 15.359 16.654
5 2013-2015 2 30 Rarefaction 0.976 15.459 0.361 14.752 16.167
6 2013-2015 2 70 Extrapolation 0.993 15.477 0.361 14.770 16.185
7 2016-2018 0 30 Rarefaction 0.972 17.503 0.526 16.473 18.533
8 2016-2018 0 70 Extrapolation 0.988 18.705 1.092 16.565 20.845
9 2016-2018 1 30 Rarefaction 0.972 15.729 0.365 15.014 16.444
10 2016-2018 1 70 Extrapolation 0.988 15.817 0.361 15.110 16.524
11 2016-2018 2 30 Rarefaction 0.972 15.268 0.348 14.586 15.950
12 2016-2018 2 70 Extrapolation 0.988 15.290 0.348 14.608 15.971
FUNCTION ObsAsy3D: ASYMPTOTIC AND OBSERVED
DIVERSITY PROFILES
ObsAsy3D(data, diversity = "TD", q = seq(0, 2, 0.2), datatype = "abundance",
nboot = 50, conf = 0.95, nT = NULL,
method = c("Asymptotic", "Observed"),
PDtree, PDreftime = NULL, PDtype = "meanPD",
FDdistM, FDtype = "AUC", FDtau = NULL, FDcut_number = 50
)
All arguments in the above function are the same as those for the
main function iNEXT3D
(except that the default of
q
here is seq(0, 2, 0.2)
). The function
ObsAsy3D()
computes observed and asymptotic diversity of
order q between 0 and 2 (in increments of 0.2) for 3D diversity; these
3D values with different order q can be used to depict a q-profile in
the ggObsAsy3D
function.
It also computes observed and asymptotic PD for various reference
times by specifying the argument PDreftime
; these PD values
with different reference times can be used to depict a time-profile in
the ggObsAsy3D
function.
It also computes observed and asymptotic FD for various threshold tau
levels by specifying the argument FDtau
; these FD values
with different threshold levels can be used to depict a tau-profile in
the ggObsAsy3D
function.
For each dimension, by default, both the observed and asymptotic
diversity estimates will be computed.
FUNCTION ggObsAsy3D(): GRAPHIC DISPLAYS OF
DIVERSITY PROFILES
ggObsAsy3D(output, profile = "q")
ggObsAsy3D
is a ggplot2 extension for an
ObsAsy3D
object to plot 3D q-profile (which depicts the
observed diversity and asymptotic diversity estimate with respect to
order q) for q between 0 and 2 (in increments of 0.2).
It also plots time-profile (which depicts the observed and asymptotic
estimate of PD or mean PD with respect to reference times when
diversity = "PD"
specified in the ObsAsy3D function), and
tau-profile (which depicts the observed and asymptotic estimate of FD
with respect to threshold level tau when diversity = "FD"
and FDtype = "tau_values"
specified in the
ObsAsy3D
function) based on the output from the function
ObsAsy3D
.
In the plot of profiles, only confidence intervals of the asymptotic
diversity will be shown when both the observed and asymptotic diversity
estimates are computed.
TAXONOMIC DIVERSITY (TD):
q-profiles
Example 10a: TD q-profiles for abundance data
The following commands returns the observed and asymptotic taxonomic
diversity (‘TD’) for the Brazil_rainforest_abun_data
, along
with its confidence interval for diversity order q between 0 to 2. Here
only the first ten rows of the output are shown.
data(Brazil_rainforest_abun_data)
output_ObsAsy_TD_abun <- ObsAsy3D(Brazil_rainforest_abun_data, diversity = 'TD',
datatype = "abundance")
output_ObsAsy_TD_abun
Assemblage Order.q qTD s.e. qTD.LCL qTD.UCL Method
1 Edge 0.0 444.971 27.945 390.200 499.743 Asymptotic
2 Edge 0.2 375.270 19.335 337.374 413.167 Asymptotic
3 Edge 0.4 312.452 12.736 287.490 337.414 Asymptotic
4 Edge 0.6 258.379 8.372 241.970 274.789 Asymptotic
5 Edge 0.8 213.730 5.999 201.971 225.488 Asymptotic
6 Edge 1.0 178.000 4.940 168.318 187.682 Asymptotic
7 Edge 1.2 149.914 4.508 141.079 158.750 Asymptotic
8 Edge 1.4 127.945 4.345 119.429 136.460 Asymptotic
9 Edge 1.6 110.672 4.320 102.206 119.139 Asymptotic
10 Edge 1.8 96.948 4.375 88.374 105.522 Asymptotic
The following commands plot the corresponding q-profiles, along with
its confidence interval for q between 0 to 2.
# q-profile curves
ggObsAsy3D(output_ObsAsy_TD_abun)
Example 10b: TD q-profiles for incidence data
The following commands return the observed and asymptotic taxonomic
diversity (‘TD’) estimates for the Fish_incidence_data
,
along with its confidence interval for diversity order q between 0 to 2.
Here only the first ten rows of the output are shown.
data(Fish_incidence_data)
output_ObsAsy_TD_inci <- ObsAsy3D(Fish_incidence_data, diversity = 'TD',
datatype = "incidence_raw")
output_ObsAsy_TD_inci
Assemblage Order.q qTD s.e. qTD.LCL qTD.UCL Method
1 2013-2015 0.0 59.803 9.032 42.101 77.506 Asymptotic
2 2013-2015 0.2 50.828 5.275 40.489 61.167 Asymptotic
3 2013-2015 0.4 43.790 3.055 37.802 49.778 Asymptotic
4 2013-2015 0.6 38.458 1.903 34.728 42.188 Asymptotic
5 2013-2015 0.8 34.490 1.350 31.844 37.136 Asymptotic
6 2013-2015 1.0 31.542 1.079 29.428 33.656 Asymptotic
7 2013-2015 1.2 29.328 0.932 27.501 31.154 Asymptotic
8 2013-2015 1.4 27.635 0.844 25.980 29.289 Asymptotic
9 2013-2015 1.6 26.312 0.787 24.769 27.855 Asymptotic
10 2013-2015 1.8 25.255 0.748 23.789 26.722 Asymptotic
The following commands plot the corresponding q-profiles, along with
its confidence interval for q between 0 to 2.
# q-profile curves
ggObsAsy3D(output_ObsAsy_TD_inci)
PHYLOGENETIC DIVERSITY (PD): time-profiles
and q-profiles
Example 11a: PD time-profiles for abundance data
The following commands return the observed and asymptotic
phylogenetic diversity (‘PD’) estimates for the
Brazil_rainforest_abun_data
, along with its confidence
interval for diversity order q = 0, 1, 2 under reference times from 0.01
to 400 (tree height). Here only the first ten rows of the output are
shown.
data(Brazil_rainforest_abun_data)
data(Brazil_rainforest_phylo_tree)
data <- Brazil_rainforest_abun_data
tree <- Brazil_rainforest_phylo_tree
output_ObsAsy_PD_abun <- ObsAsy3D(data, diversity = 'PD', q = c(0, 1, 2),
PDreftime = seq(0.01, 400, length.out = 20),
datatype = "abundance", nboot = 20, PDtree = tree)
output_ObsAsy_PD_abun
Assemblage Order.q qPD s.e. qPD.LCL qPD.UCL Method Reftime Type
1 Edge 0 444.971 28.711 388.699 501.244 Asymptotic 0.100 meanPD
2 Edge 1 178.000 5.395 167.426 188.573 Asymptotic 0.100 meanPD
3 Edge 2 85.905 4.390 77.301 94.510 Asymptotic 0.100 meanPD
4 Interior 0 513.518 36.385 442.205 584.831 Asymptotic 0.100 meanPD
5 Interior 1 186.983 4.265 178.624 195.342 Asymptotic 0.100 meanPD
6 Interior 2 74.718 3.501 67.856 81.579 Asymptotic 0.100 meanPD
7 Edge 0 371.100 28.093 316.039 426.161 Asymptotic 10.354 meanPD
8 Edge 1 141.418 4.460 132.677 150.160 Asymptotic 10.354 meanPD
9 Edge 2 72.848 3.408 66.169 79.528 Asymptotic 10.354 meanPD
10 Interior 0 413.568 25.035 364.500 462.635 Asymptotic 10.354 meanPD
The argument profile = "time"
in the
ggObsAsy3D
function creates a separate plot for each
diversity order q = 0, 1, and 2 with x-axis being “Reference time”.
Different assemblages will be represented by different color lines.
# time-profile curves
ggObsAsy3D(output_ObsAsy_PD_abun, profile = "time")
Example 11b: PD q-profiles for incidence data
The following commands return the observed and asymptotic taxonomic
diversity (‘PD’) estimates for the Fish_incidence_data
,
along with its confidence interval for diversity order q between 0 to 2.
Here only the first ten rows of the output are shown.
data(Fish_incidence_data)
data(Fish_phylo_tree)
data <- Fish_incidence_data
tree <- Fish_phylo_tree
output_ObsAsy_PD_inci <- ObsAsy3D(data, diversity = 'PD', q = seq(0, 2, 0.2),
datatype = "incidence_raw", nboot = 20, PDtree = tree,
PDreftime = NULL)
output_ObsAsy_PD_inci
Assemblage Order.q qPD s.e. qPD.LCL qPD.UCL Method Reftime Type
1 2013-2015 0.0 10.039 0.834 8.406 11.673 Asymptotic 0.977 meanPD
2 2013-2015 0.2 9.462 0.423 8.633 10.292 Asymptotic 0.977 meanPD
3 2013-2015 0.4 8.802 0.263 8.286 9.318 Asymptotic 0.977 meanPD
4 2013-2015 0.6 8.329 0.188 7.961 8.697 Asymptotic 0.977 meanPD
5 2013-2015 0.8 7.985 0.154 7.683 8.287 Asymptotic 0.977 meanPD
6 2013-2015 1.0 7.729 0.139 7.456 8.002 Asymptotic 0.977 meanPD
7 2013-2015 1.2 7.533 0.134 7.270 7.795 Asymptotic 0.977 meanPD
8 2013-2015 1.4 7.378 0.133 7.116 7.639 Asymptotic 0.977 meanPD
9 2013-2015 1.6 7.252 0.136 6.986 7.517 Asymptotic 0.977 meanPD
10 2013-2015 1.8 7.147 0.139 6.874 7.419 Asymptotic 0.977 meanPD
The following commands plot the corresponding q-profiles, along with
its confidence interval for q between 0 to 2, for the default reference
time = 0.977 (the tree depth).
# q-profile curves
ggObsAsy3D(output_ObsAsy_PD_inci, profile = "q")
FUNCTIONAL DIVERSITY (FD): tau-profiles
and q-profiles
Example 12a: FD tau-profiles for abundance data
The following commands returns observed and asymptotic functional
diversity (‘FD’) for Brazil_rainforest_abun_data
, along
with its confidence interval at diversity order q = 0, 1, 2 under tau
values from 0 to 1. Here only the first ten rows of the output are
shown.
data(Brazil_rainforest_abun_data)
data(Brazil_rainforest_distance_matrix)
data <- Brazil_rainforest_abun_data
distM <- Brazil_rainforest_distance_matrix
output_ObsAsy_FD_abun_tau <- ObsAsy3D(data, diversity = 'FD', q = c(0, 1, 2),
datatype = "abundance", nboot = 10, FDdistM = distM,
FDtype = 'tau_values', FDtau = seq(0, 1, 0.05))
output_ObsAsy_FD_abun_tau
Assemblage Order.q qFD s.e. qFD.LCL qFD.UCL Method Tau
1 Edge 0 444.971 34.314 377.717 512.226 Asymptotic 0.00
2 Edge 1 178.000 4.857 168.479 187.520 Asymptotic 0.00
3 Edge 2 85.905 4.235 77.604 94.206 Asymptotic 0.00
4 Edge 0 79.904 26.295 28.368 131.440 Asymptotic 0.05
5 Edge 1 45.187 1.448 42.350 48.024 Asymptotic 0.05
6 Edge 2 32.092 1.128 29.882 34.302 Asymptotic 0.05
7 Edge 0 73.276 25.542 23.215 123.336 Asymptotic 0.10
8 Edge 1 42.200 1.439 39.380 45.019 Asymptotic 0.10
9 Edge 2 30.182 1.111 28.004 32.360 Asymptotic 0.10
10 Edge 0 35.509 25.624 0.000 85.731 Asymptotic 0.15
The following commands plot the corresponding tau-profiles, along
with its confidence interval for diversity order q = 0, 1, 2.
# tau-profile curves
ggObsAsy3D(output_ObsAsy_FD_abun_tau, profile = "tau")
Example 12b: FD q-profiles for abundance data
The following commands returns the observed and asymptotic taxonomic
diversity (‘FD’) for the Brazil_rainforest_abun_data
, along
with its confidence interval for diversity order q between 0 to 2 with
FDtype = 'AUC'
. Here only the first ten rows of the output
are shown.
data(Brazil_rainforest_abun_data)
data(Brazil_rainforest_distance_matrix)
data <- Brazil_rainforest_abun_data
distM <- Brazil_rainforest_distance_matrix
output_ObsAsy_FD_abun <- ObsAsy3D(data, diversity = 'FD', q = seq(0, 2, 0.5),
datatype = "abundance", nboot = 10,
FDdistM = distM, FDtype = 'AUC')
output_ObsAsy_FD_abun
Assemblage Order.q qFD s.e. qFD.LCL qFD.UCL Method
1 Edge 0.0 19.008 6.320 6.621 31.395 Asymptotic
2 Edge 0.5 14.714 1.215 12.333 17.094 Asymptotic
3 Edge 1.0 12.058 0.337 11.397 12.719 Asymptotic
4 Edge 1.5 10.369 0.295 9.791 10.947 Asymptotic
5 Edge 2.0 9.254 0.301 8.665 9.843 Asymptotic
6 Interior 0.0 18.215 5.591 7.257 29.174 Asymptotic
7 Interior 0.5 13.084 1.060 11.006 15.163 Asymptotic
8 Interior 1.0 9.935 0.304 9.339 10.532 Asymptotic
9 Interior 1.5 8.115 0.187 7.749 8.481 Asymptotic
10 Interior 2.0 7.067 0.150 6.772 7.361 Asymptotic
The following commands plot the corresponding q-profiles, along with
its confidence interval for q between 0 to 2.
# q-profile curves
ggObsAsy3D(output_ObsAsy_FD_abun, profile = "q")
Example 12c: FD q-profiles for incidence data
The following commands returns observed and asymptotic functional
diversity (‘FD’) for Fish_incidence_data
, along with its
confidence interval at diversity order q from 0 to 2. Here only the
first ten rows of the output are shown.
data(Fish_incidence_data)
data(Fish_distance_matrix)
data <- Fish_incidence_data
distM <- Fish_distance_matrix
output_ObsAsy_FD_inci <- ObsAsy3D(data, diversity = 'FD', datatype = "incidence_raw",
nboot = 20, FDdistM = distM, FDtype = 'AUC')
output_ObsAsy_FD_inci
Assemblage Order.q qFD s.e. qFD.LCL qFD.UCL Method
1 2013-2015 0.0 18.916 1.292 16.384 21.449 Asymptotic
2 2013-2015 0.2 17.828 0.660 16.535 19.120 Asymptotic
3 2013-2015 0.4 17.117 0.439 16.256 17.978 Asymptotic
4 2013-2015 0.6 16.626 0.380 15.880 17.372 Asymptotic
5 2013-2015 0.8 16.285 0.367 15.566 17.005 Asymptotic
6 2013-2015 1.0 16.044 0.363 15.333 16.755 Asymptotic
7 2013-2015 1.2 15.869 0.360 15.163 16.574 Asymptotic
8 2013-2015 1.4 15.738 0.358 15.036 16.439 Asymptotic
9 2013-2015 1.6 15.636 0.356 14.938 16.335 Asymptotic
10 2013-2015 1.8 15.556 0.355 14.860 16.253 Asymptotic
The following commands plot the corresponding q-profiles, along with
its confidence interval for q between 0 to 2.
# q-profile curves
ggObsAsy3D(output_ObsAsy_FD_inci, profile = "q")
License
The iNEXT.3D package is licensed under the GPLv3. To help refine
iNEXT.3D
, your comments or feedback would be welcome
(please send them to Anne Chao or report an issue on the iNEXT.3D github
iNEXT.3D_github.
References
Chao, A., Henderson, P. A., Chiu, C.-H., Moyes, F., Hu, K.-H.,
Dornelas, M. and Magurran, A. E. (2021). Measuring temporal change in
alpha diversity: a framework integrating taxonomic, phylogenetic and
functional diversity and the iNEXT.3D standardization. Methods in
Ecology and Evolution, 12, 1926-1940.
Hsieh, T. C., Ma, K-H, and Chao, A. (2016). iNEXT: An R package
for rarefaction and extrapolation of species diversity (Hill numbers).
Methods in Ecology and Evolution, 7, 1451-1456.