iNEXT.link
is an R package that extends the concepts of
iNEXT.3D
(Chao et al., 2021), iNEXT.4step
(Chao et al., 2020) and iNEXT.beta3D
(Chao et al., 2023) to
ecological networks (Chiu et al., 2023). In this document, we provide a
brief overview of iNEXT.link
and its functionalities.
Detailed information about the iNEXT.link
functions can be
found in the iNEXT.link
manual, which is also available on
Github. For users without an R
background, an online version (https://chao.shinyapps.io/iNEXT_link/) of
iNEXT.link
is also available.
iNEXT.link
is primarily designed to calculate and
analyze various measures of diversity in ecological networks.
Specifically, the package calculates three Hill numbers of order q
(species richness, Shannon diversity, and Simpson diversity) in
taxonomic diversity level, as well as phylogenetic and functional
diversity levels.
For single ecological networks, iNEXT.link
provides
tools for analyzing diversity. The package provides two types of
rarefaction and extrapolation (R/E) sampling curves to estimate
diversity and confidence intervals for single ecological networks. These
include sample-size-based (or size-based) R/E curves and coverage-based
R/E curves.
Moreover, iNEXT.link
offers dissimilarity-turnover
curves for the coverage-based R/E curves for gamma, alpha, and beta
diversity measures, which can be used to compare diversity patterns
across different ecological networks.
If you publish your work based on the results from the
iNEXT.link
package, you should make references to the
following methodology paper:
The iNEXT.link
package can be downloaded from Anne
Chao’s iNEXT.link_github
using the following commands. For a first-time installation, an
additional visualization extension package (ggplot2
) from
CRAN and (iNEXT.3D
), (iNEXT.4steps
), and
(iNEXT.beta3D
) from Anne Chao’s github must be installed
and loaded.
## install iNEXT.link package from CRAN
# install.packages("iNEXT.link") # coming soon
## install the latest version from github
install.packages('devtools')
library(devtools)
# install_github('AnneChao/iNEXT.3D')
# install_github('AnneChao/iNEXT.4steps')
# install_github('AnneChao/iNEXT.beta3D')
install_github('AnneChao/iNEXT.link')
## import packages
library(iNEXT.link)
iNEXT.link : Computes rarefaction/extrapolation taxonomic, phylogenetic, and functional diversity estimates and sample coverage estimates.
DataInfo.link : exhibits basic data information
estimateD.link : computes species diversity with a particular user-specified level of sample size or sample coverage.
AO.link: compute asymptotic or empirical(observed) diversity of order q.
Completeness.link : Calculates estimated sample completeness with order q.
Spec.link : Computes standardized specialization estimation under specified sample coverage(or observed) with order q.
ggCompleteness.link : Visualizing the output
from the function Completeness.link
ggSpec.link : Visualizing the output from the
function Spec.link
ggAO.link : Visualizing the output from the
function AO.link
ggiNEXT.link : Visualizing the output from the
function iNEXT.link
ggiNEXTbeta.link : Visualizing the output from
the function iNEXTbeta.link
First, we load data from iNEXT.link
:
We first describe the main function iNEXT.link()
with
default arguments:
iNEXT.link(data,diversity = "TD", q = c(0, 1, 2), size = NULL, nT = NULL,
endpoint = NULL, knots = 40, conf = 0.95, nboot = 30,
row.tree = NULL, col.tree = NULL, PDtype = "meanPD",
row.distM = NULL, col.distM = NULL, FDtype = "AUC", FDtau = NULL)
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 diversity estimates of order q, the sample
coverage estimates and related statistics for K (if
knots = K
) 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 diversity
estimates will be calculated. By default, endpoint = double the
reference sample size (total sample size for interaction data (so calles
abundance data in iNEXT.3D)). For example, if
endpoint = 10
, knot = 4
, diversity estimates
will be computed for a sequence of samples with sizes (1, 4, 7, 10).
Argument | Description |
---|---|
data
|
a list of data.frames , each data.frames
represents col.species-by-row.species abundance matrix.
|
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) .
|
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 reference sample size. |
knots
|
an integer specifying the number of equally-spaced knots between size 1 and the endpoint.Default is 40. |
conf
|
a positive number < 1 specifying the level of confidence interval. Default is 0.95. |
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 30. |
row.tree
|
(required only when diversity = “PD” a phylogenetic tree of row assemblage in the pooled network row assemblage. |
col.tree
|
(required only when diversity = “PD”) a phylogenetic tree of column assemblage in the pooled network column assemblage. |
PDtype
|
(required only when 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. |
row.distM
|
(required only when diversity = “FD”) a species pairwise distance matrix for all species of row assemblage in the pooled network row assemblage. |
col.distM
|
(required only when diversity = “FD”) a species pairwise distance matrix for all species of column assemblage in the pooled network column assemblage. |
FDtype
|
(required only when 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
|
(required only when 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). |
Supported Data Types:
Individual-based interaction data : Input data matrix for each assemblage/site include samples species interactions in an empirical sample of n total interactions (“reference sample”). When dealing with N networks, the input data consists of N lists of species interaction matrix.
The data set (tree-beetles interaction data) is included in
iNEXT.link package. The experiment took place in the Steigerwald forest
in Germany, where deadwood objects from six tree species were exposed in
open, net, and closed habitats. In each habitat, there are six plots (A,
B, C, D, E, F). Saproxilic beetles were sampled using stem emergence
traps and classified according to their functional traits. Data from
four years were pooled for each plot and habitat, and pairwise distances
were computed from the Gower distance. Here, the demonstration only uses
data from plot A in each habitat. For these data, the following commands
display the sample species interactions and run the
iNEXT.link()
function for three types of diversty
("TD"
, "PD"
, "FD"
with specified
threshold (default is dmean (quadratic entropy)), "AUC"
which integrates FD from threshold 0 to 1).
Under taxonomic diversity dimension, iNEXT.link()
function returns including: $DataInfo
for summarizing data
information; $iNextEst
for showing diversity estimates
along with related statistics for a series of rarefied and extrapolated
samples; and $AsyEst
for showing asymptotic diversity
estimates along with related statistics. Result under phylogenetic
diversity or functional diversity includes these three parts, too.
$DataInfo
in TD example, as shown below, returns basic
data information. It can also be presented using function
DataInfo.link()
to get the same result.
Because the three kinds of diversity output are similar, the demo shows TD only.
linkoutTD = iNEXT.link(data = beetles, diversity = 'TD', q = c(0,1,2), nboot = 30)
linkoutTD$DataInfo
#> Networks n S.obs(row) S.obs(col) Links.obs Connectance Coverage f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
#> 1 Closed 816 6 83 178 0.3574 0.8800 98 31 15 3 3 5 0 2 2 1
#> 2 Open 1932 6 88 206 0.3902 0.9431 110 33 15 8 7 5 3 2 3 2
Second part of output from function iNEXT.link
is
diversity estimates and related statistics computed for these 40 knots
by default, which locates the reference sample size at the mid-point of
the selected knots. The diversity can be based on sample-size-based and
sample coverage-based. The first data frame of list
$iNextEst
(as shown below for ‘size_based’) includes the
sample size (m
), the Method
(Rarefaction
, Observed
, or
Extrapolation
, depending on whether the size m
is less than, equal to, or greater than the reference sample size), the
diversity order (Order.q
), the diversity estimate of order
q (qD
in TD, qPD
in PD, qFD
in FD
(under specified thresholds), qAUC
in FD (area under
curve)), the lower and upper confidence limits of diversity
(qD.LCL
and qD.UCL
in TD, qPD.LCL
and qPD.UCL
in PD, qFD.LCL
and
qFD.UCL
in FD (under specified thresholds),
qAUC.LCL
and qAUC.UCL
in FD (area under
curve)) conditioning on sample size, and the sample coverage estimate
(SC
) along with the lower and upper confidence limits of
sample coverage (SC.LCL
, SC.UCL
). These sample
coverage estimates with confidence intervals are used for plotting the
sample completeness curve. It is time consuming for
diversity = FD
and FDtype = "AUC"
. If the
argument nboot
is greater than zero, then the bootstrap
method is applied to obtain the confidence intervals for each diversity
and sample coverage estimates.
Here only show first six rows:
head(linkoutTD$iNextEst$size_based)
#> # A tibble: 6 x 10
#> Assemblage m Method Order.q qD qD.LCL qD.UCL SC SC.LCL SC.UCL
#> <chr> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 Closed 1 Rarefaction 0 1 1 1 0.0295 0.0254 0.0335
#> 2 Closed 43 Rarefaction 0 28.0 27.0 29.1 0.543 0.515 0.571
#> 3 Closed 86 Rarefaction 0 44.8 42.7 46.9 0.661 0.637 0.685
#> 4 Closed 129 Rarefaction 0 58.2 55.1 61.2 0.713 0.691 0.735
#> 5 Closed 172 Rarefaction 0 69.8 65.9 73.6 0.745 0.725 0.766
#> 6 Closed 215 Rarefaction 0 80.2 75.6 84.9 0.767 0.748 0.787
The second data frame of list $iNextEst
(as shown below
for ‘coverage_based’) includes the sample coverage estimate (‘SC’), the
sample size (m
), the Method
(Rarefaction
, Observed
, or
Extrapolation
, depending on whether the size m
is less than, equal to, or greater than the reference sample size), the
diversity order (Order.q
), the diversity estimate of order
q (qD
in TD, qPD
in PD, qFD
in FD
(under specified thresholds), qAUC
in FD (area under
curve)), the lower and upper confidence limits of diversity
(qD.LCL
and qD.UCL
in TD, qPD.LCL
and qPD.UCL
in PD, qFD.LCL
and
qFD.UCL
in FD (under specified thresholds),
qAUC.LCL
and qAUC.UCL
in FD (area under
curve)) conditioning on sample coverage estimate.
Here only show first six rows:
head(linkoutTD$iNextEst$coverage_based)
#> # A tibble: 6 x 8
#> Assemblage SC m Method Order.q qD qD.LCL qD.UCL
#> <chr> <dbl> <dbl> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 Closed 0.0295 1.00 Rarefaction 0 1.00 0.937 1.06
#> 2 Closed 0.543 43.0 Rarefaction 0 28.0 24.5 31.6
#> 3 Closed 0.661 86.0 Rarefaction 0 44.8 38.7 50.8
#> 4 Closed 0.713 129. Rarefaction 0 58.2 49.9 66.4
#> 5 Closed 0.745 172. Rarefaction 0 69.8 59.6 79.9
#> 6 Closed 0.767 215. Rarefaction 0 80.2 68.4 92.1
The output $AsyEst
lists the diversity labels
(Diversity
in TD, Phylogenetic Diversity
in
PD, Functional Diversity
in FD), the observed diversity
(Observed
in TD, Phylogenetic Observed
in PD,
Functional Observed
in FD), asymptotic diversity estimates
(Estimator
in TD, Phylogenetic Estimator
in
PD, Functional Estimator
in FD), estimated bootstrap
standard error (s.e.
) and confidence intervals for
diversity with q = 0, 1, and 2 (LCL
, UCL
). The
estimated asymptotic and observed diversity can also be computed via the
function AO.link()
. The output are shown below:
Here only show first six rows:
head(linkoutTD$AsyEst)
#> Assemblage Diversity Observed Estimator s.e. LCL UCL
#> 1 Closed Species richness 178.000000 332.713393 21.092987 291.371898 374.054889
#> 2 Closed Shannon diversity 64.690053 80.316088 5.685330 69.173046 91.459130
#> 3 Closed Simpson diversity 32.627205 33.944467 2.136374 29.757251 38.131683
#> 4 Open Species richness 206.000000 389.238440 37.655649 315.434725 463.042155
#> 5 Open Shannon diversity 23.311453 25.911799 1.484906 23.001437 28.822162
#> 6 Open Simpson diversity 8.059978 8.089554 0.322261 7.457934 8.721174
The function ggiNEXT.link()
, which extends
ggplot2
with default arguments, is described as
follows:
Here outcome
is the object of
iNEXT.link()
’s output. Three types of curves are allowed
for different diversity dimensions:
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"
or
facet.var = "Assemblage"
is used to create a separate plot
for each value of the specified variable. For example, the following
code displays a separate plot of the diversity order q. The
ggiNEXT.link()
function is a wrapper with package
ggplot2
to create a R/E curve in a single line of code. The
figure object is of class "ggplot"
, so can be manipulated
by using the ggplot2
tools.
When facet.var = "Assemblage"
in
ggiNEXT.link
function, it creates a separate plot for each
network and the different color lines represent each diversity order.
Sample-size-based R/E curve (type = 1
) as below:
# Sample-size-based R/E curves, separating by "assemblage""
ggiNEXT.link(linkoutTD, type = 1, facet.var = "Assemblage")
#> [[1]]
When facet.var = "Order.q"
in ggiNEXT.link
function, it creates a separate plot for each diversity order and the
different color lines represent each network. Sample-size-based R/E
curve (type = 1
) as below:
# Sample-size-based R/E curves, separating by "Order.q"
ggiNEXT.link(linkoutTD, type = 1, facet.var = "Order.q")
#> [[1]]
The following command return the sample completeness (sample
coverage) curve (type = 2
) in which different colors are
used for the three networks.
The following commands return the coverage-based R/E sampling curves
in which different colors are used for the three assemblages
(facet.var = "Assemblage"
) and for three diversity orders
(facet.var = "Order.q"
).
DataInfo.link(data, diversity = "TD", row.tree = NULL,
col.tree = NULL, row.distM = NULL, col.distM = NULL)
Here provide the function DataInfo.link
to compute three
diversity dimensions (‘TD’, ‘PD’, ‘FD’) data information, which
including sample size, observed species richness, sample coverage
estimate, and the first ten interaction frequency counts when
diversity = TD
. And so on for PD, FD.
DataInfo.link(beetles, diversity = 'TD')
#> Networks n S.obs(row) S.obs(col) Links.obs Connectance Coverage f1 f2 f3 f4 f5 f6 f7 f8 f9 f10
#> 1 Closed 816 6 83 178 0.3574 0.8800 98 31 15 3 3 5 0 2 2 1
#> 2 Open 1932 6 88 206 0.3902 0.9431 110 33 15 8 7 5 3 2 3 2
DataInfo.link(beetles, diversity = 'PD', col.tree = beetles_col_tree)
#> Networks n S.obs(row) S.obs(col) Links.obs Connectance f1* f2* g1 g2 PD.obs mean_T
#> 1 Closed 816 6 83 178 0.3574 171 76 11508.99 3873.052 924 285
#> 2 Open 1932 6 88 206 0.3902 190 76 13918.45 5172.410 1014 285
DataInfo.link(beetles, diversity = 'FD', col.distM = beetles_col_distM)
#> Networks n S.obs(row) S.obs(col) Links.obs Connectance f1 f2 a1' a2' threshold
#> 1 Closed 816 6 83 178 0.3574 98 31 0 0 8.930741
#> 2 Open 1932 6 88 206 0.3902 110 33 0 0 8.021019
estimateD.link(data, diversity = "TD", q = c(0, 1, 2),
base = "coverage", level = NULL, nboot = 50, conf = 0.95,
PDtype = "meanPD", row.tree = NULL, col.tree = NULL, row.distM = NULL,
col.distM = NULL, FDtype = "AUC", FDtau = NULL)
estimateD.link
is used to compute three diversity
dimensions (TD, PD, FD) estimates with q = 0, 1, 2 under any specified
level of sample size (when base = "size"
) or sample
coverage (when base = "coverage"
). If
level = NULL
, this function computes the diversity
estimates for the minimum sample size among all samples extrapolated to
double reference sizes (when base = "size"
) or the minimum
sample coverage among all samples extrapolated to double reference sizes
(when base = "coverage"
).
For example, the following command returns the taxonomic diversity (‘TD’) with a specified level of sample coverage of 95% for the tree-beetles interaction data. For some networks, this coverage value corresponds to the rarefaction part whereas the others correspond to extrapolation, as indicated in the method of the output.
estimateD.link(beetles, diversity = 'TD', q = c(0, 1, 2), base = "coverage", level = 0.95)
#> Assemblage m Method Order.q SC qD s.e. qD.LCL qD.UCL
#> 1 Closed 1944.292 Extrapolation 0 0.95 268.252103 24.0913411 221.033942 315.470264
#> 2 Closed 1944.292 Extrapolation 1 0.95 74.577021 4.5887206 65.583294 83.570748
#> 3 Closed 1944.292 Extrapolation 2 0.95 33.378889 2.0538921 29.353334 37.404443
#> 4 Open 2349.132 Extrapolation 0 0.95 228.271774 19.9020939 189.264386 267.279161
#> 5 Open 2349.132 Extrapolation 1 0.95 23.704215 1.0910254 21.565844 25.842585
#> 6 Open 2349.132 Extrapolation 2 0.95 8.065214 0.2777015 7.520929 8.609499
AO.link(data, diversity = "TD", q = seq(0, 2, 0.2), nboot = 30,
conf = 0.95, method = c("Asymptotic", "Observed"),
row.tree = NULL, col.tree = NULL, PDtype = "meanPD", row.distM = NULL,
col.distM = NULL, FDtype = "AUC", FDtau = NULL)
The function AO.link()
compute three diversity
dimensions (TD, PD, FD) for empirical (observed) diversity and estimated
asymptotic diversity with any diversity order. For example, the
following commands returns empirical and asymptotic taxonomic diversity
(‘TD’) for dunes data, along with its confidence interval at diversity
order q from 0 to 2. Here only show the first ten rows.
out1 <- AO.link(beetles, diversity = 'TD', q = seq(0, 2, 0.2), method = c("Asymptotic", "Observed"),
nboot = 5,conf = 0.95)
out1
#> Order.q qD s.e. qD.LCL qD.UCL Network Method
#> 1 0.0 332.713393 48.2098210 289.081592 405.008564 Closed Asymptotic
#> 2 0.2 265.977501 33.1087163 236.310993 315.175313 Closed Asymptotic
#> 3 0.4 203.167245 20.8108798 185.410930 233.267932 Closed Asymptotic
#> 4 0.6 149.540048 12.5343199 135.662434 166.251688 Closed Asymptotic
#> 5 0.8 108.592546 8.0745502 97.542391 117.591658 Closed Asymptotic
#> 6 1.0 80.316088 5.9032223 71.566191 85.800022 Closed Asymptotic
#> 7 1.2 61.983531 4.6961863 54.977660 65.951604 Closed Asymptotic
#> 8 1.4 50.295815 3.9150902 44.512426 53.602746 Closed Asymptotic
#> 9 1.6 42.699384 3.3781728 37.777693 45.675592 Closed Asymptotic
#> 10 1.8 37.568079 2.9976540 33.264005 40.339520 Closed Asymptotic
#> 11 2.0 33.944467 2.7191523 30.086223 36.562253 Closed Asymptotic
#> 12 0.0 389.238440 45.2211992 324.916308 430.644659 Open Asymptotic
#> 13 0.2 263.223968 27.1903425 226.200574 288.607555 Open Asymptotic
#> 14 0.4 159.174040 13.8420191 141.672278 174.144176 Open Asymptotic
#> 15 0.6 86.647814 5.8015139 80.428703 94.145091 Open Asymptotic
#> 16 0.8 45.571274 2.1534906 44.080978 48.850473 Open Asymptotic
#> 17 1.0 25.911799 0.9387671 25.231202 27.360657 Open Asymptotic
#> 18 1.2 16.963237 0.5865342 16.348318 17.704642 Open Asymptotic
#> 19 1.4 12.643810 0.4499512 12.096680 13.080679 Open Asymptotic
#> 20 1.6 10.333946 0.3756843 9.858487 10.688079 Open Asymptotic
#> 21 1.8 8.967960 0.3291678 8.546811 9.288658 Open Asymptotic
#> 22 2.0 8.089554 0.2983439 7.707035 8.385198 Open Asymptotic
#> 23 0.0 178.000000 5.4129474 171.200000 185.000000 Closed Empirical
#> 24 0.2 149.140436 4.7055148 143.114506 155.157511 Closed Empirical
#> 25 0.4 122.284123 4.0004627 117.016505 127.221430 Closed Empirical
#> 26 0.6 98.784711 3.3575967 94.184014 102.727972 Closed Empirical
#> 27 0.8 79.539008 2.8197185 75.547191 82.548128 Closed Empirical
#> 28 1.0 64.690053 2.3990206 61.238194 66.905358 Closed Empirical
#> 29 1.2 53.711702 2.0823376 50.716402 55.471642 Closed Empirical
#> 30 1.4 45.761569 1.8466022 43.140628 47.492554 Closed Empirical
#> 31 1.6 40.008527 1.6701792 37.690631 41.704129 Closed Empirical
#> 32 1.8 35.788959 1.5365744 33.716773 37.457252 Closed Empirical
#> 33 2.0 32.627205 1.4341195 30.756392 34.263969 Closed Empirical
#> 34 0.0 206.000000 8.7578536 195.800000 217.400000 Open Empirical
#> 35 0.2 147.911160 6.4665997 140.474610 156.398119 Open Empirical
#> 36 0.4 98.276240 4.3751874 93.641331 104.224830 Open Empirical
#> 37 0.6 60.906771 2.7417131 58.600588 64.847779 Open Empirical
#> 38 0.8 36.832763 1.6956000 35.493951 39.346943 Open Empirical
#> 39 1.0 23.311453 1.1106562 22.268450 24.917021 Open Empirical
#> 40 1.2 16.195155 0.7846134 15.410778 17.288623 Open Empirical
#> 41 1.4 12.394607 0.5922222 11.795669 13.192906 Open Empirical
#> 42 1.6 10.237828 0.4722733 9.764644 10.855519 Open Empirical
#> 43 1.8 8.920980 0.3938442 8.533872 9.423400 Open Empirical
#> 44 2.0 8.059978 0.3403697 7.733733 8.485316 Open Empirical
ggAO.link()
plots q-profile based on
ggplot2
. Here outcome
is the object from the
function AO.link
.
Function Completeness.link()
provides a easy way to
compute estimated sample completeness with order q. The arguments is
below:
Argument | Description |
---|---|
data
|
a list of data.frames , each
data.frames represents col.species-by-row.species abundance
matrix.
|
q
|
a numerical vector specifying the diversity orders. Default is (0, 0.2, 0.4,…, 2). |
nboot
|
a positive integer specifying the number of bootstrap replications when
assessing sampling uncertainty and constructing confidence intervals.
Bootstrap replications are generally time consuming. Enter 0 to skip the
bootstrap procedures. Default is 30 .
|
conf
|
a positive number < 1 specifying the level of confidence interval.
Default is 0.95 .
|
We also provides a realized function ggCompleteness.link
to plot the output from Completeness.link()
:
Argument | Description |
---|---|
output
|
a table generated from function Completeness.link .
|
Use data beetles to calculate sample completeness and plot it.
The main function Spec.link()
with default
arguments:
Spec.link(data, q = seq(0, 2, 0.2), method = "Estimated",
nboot = 30, conf = 0.95, E.class = c(1:5), C = NULL)
Argument | Description |
---|---|
data
|
a list of data.frames , each
data.frames represents col.species-by-row.species abundance
matrix.
|
q
|
a numerical vector specifying the diversity orders. Default is (0, 0.2, 0.4,…, 2). |
method
|
a binary calculation method with ‘Estimated’ or ‘Observed’. |
nboot
|
a positive integer specifying the number of bootstrap replications when
assessing sampling uncertainty and constructing confidence intervals.
Bootstrap replications are generally time consuming. Enter 0 to skip the
bootstrap procedures. Default is 30 .
|
conf
|
a positive number < 1 specifying the level of confidence interval.
Default is 0.95 .
|
E.class
|
an integer vector between 1 to 5. There are five transformation for evenness in Chao and Ricotta (2019). Default is 1:5. |
C
|
a standardized coverage for calculating evenness index. It is used when
method = 'Estimated' . If NULL , then this
function computes the diversity estimates for the minimum sample
coverage among all samples extrapolated to double reference sizes
(C = Cmax ).
|
The function ggSpec.link()
is provided to plot the
output from Spec.link()
.
Argument | Description |
---|---|
output
|
a table generated from function Spec.link .
|
There is an example for function Spec.link
and function
ggSpec.link
.
iNEXTbeta.link(data, diversity = "TD", level = seq(0.5, 1, 0.05),
q = c(0, 1, 2), nboot = 20, conf = 0.95,
PDtype = "meanPD", row.tree = NULL, col.tree = NULL, row.distM = NULL,
col.distM = NULL, FDtype = "AUC", FDtau = NULL, FDcut_number = 30)
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 gamma, alpha and beta diversity estimates of
order q at specified sample coverage and measures of dissimilarity. By
default of base = “coverage”
and level = NULL
,
then this function computes the gamma, alpha, beta diversity, and four
dissimilarity-turnover indices estimates up to one (for q = 1, 2) or up
to the coverage of double the reference sample size (for q = 0).
Argument | Description |
---|---|
data
|
data can be input as a list} of |
diversity
|
selection of diversity type: TD = Taxonomic diversity,
PD = Phylogenetic diversity, and FD =
Functional diversity.
|
level
|
a sequence specifying the particular sample coverages (between 0 and 1).
Default is seq(0.5, 1, 0.05) .
|
q
|
a numerical vector specifying the diversity orders. Default is
c(0, 1, 2) .
|
nboot
|
a positive integer specifying the number of bootstrap replications when
assessing sampling uncertainty and constructing confidence intervals.
Bootstrap replications are generally time consuming. Enter
0 to skip the bootstrap procedures. Default is
30 .
|
conf
|
a positive number < 1 specifying the level of confidence interval.
Default is 0.95 .
|
PDtype
|
(required only when diversity = “PD” ), select PD type:
PDtype = “PD” (effective total branch length) or
PDtype = “meanPD” (effective number of equally divergent
lineages). Default is “meanPD” .
|
row.tree
|
(required only when diversity = “PD” ), a phylogenetic tree
of row assemblage in the pooled network row assemblage.
|
col.tree
|
(required only when diversity = “PD” ), a phylogenetic tree
of column assemblage in the pooled network column assemblage.
|
row.disM
|
(required only when diversity = “FD” ), a species pairwise
distance matrix for all species of row assemblage in the pooled network
row assemblage.
|
col.disM
|
(required only when diversity = “PD” ), a species pairwise
distance matrix for all species of column assemblage in the pooled
network column assemblage.
|
FDtype
|
(required only when diversity = “FD” ), select FD type:
FDtype = “tau_value” for FD under a specified threshold
value, 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
|
(required only when diversity = “FD” and FDtype =
“tau_value” ), a numerical value between 0 and 1 specifying the
tau value (threshold level). 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).
|
the iNEXTbeta.link()
function returns the
"iNEXTbeta.link"
object including seven data frames for
each datasets:
Here only show the first six rows in each table output:
# Taxonomic diversity
Abundance_TD = iNEXTbeta.link(data = beetles, diversity = 'TD', level = NULL, q = c(0, 1, 2))
Abundance_TD
#> $gamma
#> Dataset Order.q SC Size Gamma Method s.e. LCL UCL Diversity
#> 1 Dataset_1 0 0.500 20.941 13.978 Rarefaction 0.775 12.459 15.498 TD
#> 2 Dataset_1 0 0.525 25.102 16.017 Rarefaction 0.911 14.232 17.801 TD
#> 3 Dataset_1 0 0.550 30.426 18.489 Rarefaction 1.060 16.412 20.566 TD
#> 4 Dataset_1 0 0.575 37.171 21.450 Rarefaction 1.216 19.066 23.833 TD
#> 5 Dataset_1 0 0.600 45.591 24.932 Rarefaction 1.380 22.228 27.635 TD
#> 6 Dataset_1 0 0.625 56.005 28.975 Rarefaction 1.558 25.922 32.028 TD
#>
#> $alpha
#> Dataset Order.q SC Size Alpha Method s.e. LCL UCL Diversity
#> 1 Dataset_1 0 0.500 25.949 8.432 Rarefaction 0.571 7.313 9.551 TD
#> 2 Dataset_1 0 0.525 32.249 9.972 Rarefaction 0.669 8.660 11.284 TD
#> 3 Dataset_1 0 0.550 40.247 11.826 Rarefaction 0.756 10.344 13.309 TD
#> 4 Dataset_1 0 0.575 50.044 13.974 Rarefaction 0.831 12.345 15.603 TD
#> 5 Dataset_1 0 0.600 61.802 16.403 Rarefaction 0.901 14.637 18.169 TD
#> 6 Dataset_1 0 0.625 75.870 19.132 Rarefaction 0.974 17.224 21.041 TD
#>
#> $beta
#> Dataset Order.q SC Size Beta Method s.e. LCL UCL Diversity
#> 1 Dataset_1 0 0.500 25.949 1.658 Rarefaction 0.023 1.612 1.704 TD
#> 2 Dataset_1 0 0.525 32.249 1.606 Rarefaction 0.024 1.559 1.653 TD
#> 3 Dataset_1 0 0.550 40.247 1.563 Rarefaction 0.024 1.517 1.610 TD
#> 4 Dataset_1 0 0.575 50.044 1.535 Rarefaction 0.023 1.490 1.580 TD
#> 5 Dataset_1 0 0.600 61.802 1.520 Rarefaction 0.023 1.475 1.565 TD
#> 6 Dataset_1 0 0.625 75.870 1.514 Rarefaction 0.023 1.470 1.559 TD
#>
#> $`1-C`
#> Dataset Order.q SC Size Dissimilarity Method s.e. LCL UCL Diversity
#> 1 Dataset_1 0 0.500 25.949 0.658 Rarefaction 0.023 0.612 0.704 TD
#> 2 Dataset_1 0 0.525 32.249 0.606 Rarefaction 0.024 0.559 0.653 TD
#> 3 Dataset_1 0 0.550 40.247 0.563 Rarefaction 0.024 0.517 0.610 TD
#> 4 Dataset_1 0 0.575 50.044 0.535 Rarefaction 0.023 0.490 0.580 TD
#> 5 Dataset_1 0 0.600 61.802 0.520 Rarefaction 0.023 0.475 0.565 TD
#> 6 Dataset_1 0 0.625 75.870 0.514 Rarefaction 0.023 0.470 0.559 TD
#>
#> $`1-U`
#> Dataset Order.q SC Size Dissimilarity Method s.e. LCL UCL Diversity
#> 1 Dataset_1 0 0.500 25.949 0.794 Rarefaction 0.017 0.761 0.826 TD
#> 2 Dataset_1 0 0.525 32.249 0.755 Rarefaction 0.018 0.719 0.791 TD
#> 3 Dataset_1 0 0.550 40.247 0.721 Rarefaction 0.019 0.684 0.758 TD
#> 4 Dataset_1 0 0.575 50.044 0.697 Rarefaction 0.019 0.660 0.735 TD
#> 5 Dataset_1 0 0.600 61.802 0.684 Rarefaction 0.019 0.646 0.722 TD
#> 6 Dataset_1 0 0.625 75.870 0.679 Rarefaction 0.020 0.641 0.718 TD
#>
#> $`1-V`
#> Dataset Order.q SC Size Dissimilarity Method s.e. LCL UCL Diversity
#> 1 Dataset_1 0 0.500 25.949 0.658 Rarefaction 0.023 0.612 0.704 TD
#> 2 Dataset_1 0 0.525 32.249 0.606 Rarefaction 0.024 0.559 0.653 TD
#> 3 Dataset_1 0 0.550 40.247 0.563 Rarefaction 0.024 0.517 0.610 TD
#> 4 Dataset_1 0 0.575 50.044 0.535 Rarefaction 0.023 0.490 0.580 TD
#> 5 Dataset_1 0 0.600 61.802 0.520 Rarefaction 0.023 0.475 0.565 TD
#> 6 Dataset_1 0 0.625 75.870 0.514 Rarefaction 0.023 0.470 0.559 TD
#>
#> $`1-S`
#> Dataset Order.q SC Size Dissimilarity Method s.e. LCL UCL Diversity
#> 1 Dataset_1 0 0.500 25.949 0.794 Rarefaction 0.017 0.761 0.826 TD
#> 2 Dataset_1 0 0.525 32.249 0.755 Rarefaction 0.018 0.719 0.791 TD
#> 3 Dataset_1 0 0.550 40.247 0.721 Rarefaction 0.019 0.684 0.758 TD
#> 4 Dataset_1 0 0.575 50.044 0.697 Rarefaction 0.019 0.660 0.735 TD
#> 5 Dataset_1 0 0.600 61.802 0.684 Rarefaction 0.019 0.646 0.722 TD
#> 6 Dataset_1 0 0.625 75.870 0.679 Rarefaction 0.020 0.641 0.718 TD
The output contains seven data frames: gamma
,
alpha
, beta
, C
, U
,
V
, S
. For each data frame, it includes the
diversity estimate (Estimate
), the diversity order
(Order.q
), Method
(Rarefaction, Observed, or
Extrapolation, depending on whether the size m
is less
than, equal to, or greater than the reference sample size), the sample
coverage estimate (SC
), the sample size
(Size
), the standard error from bootstrap replications
(s.e.
), the lower and upper confidence limits of diversity
(LCL
, UCL
), and the name of dataset
(Dataset
). These diversity estimates with confidence
intervals are used for plotting the diversity curve.
The function ggiNEXTbeta.link()
, which extends
ggplot2
to the "iNEXT.link"
object with
default arguments, is described as follows:
Argument | Description |
---|---|
output
|
the output of iNEXTbeta.link .
|
type
|
selection of plot type : type = ‘B’ for plotting the gamma, alpha, and beta diversity; type = ‘D’ for plotting 4 turnover dissimilarities. |
The ggiNEXTbeta.link()
function is a wrapper around the
ggplot2
package to create a R/E curve using a single line
of code. The resulting object is of class "ggplot"
, so it
can be manipulated using the ggplot2
tools. Users can
visualize the output of beta diversity or four dissimilarities by
setting the parameter type
:
The iNEXT.link package is licensed under the GPLv3. To help refine
iNEXT.link
, your comments or feedback would be welcome
(please send them to Anne Chao or report an issue on the iNEXT.link
github iNEXT.link_github.
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. & Jost, L. (2012) Coverage-based rarefaction and extrapolation: standardizing samples by completeness rather than size. Ecology, 93, 2533