View source: R/mobr_boxplots.R
calc_comm_div_ci | R Documentation |
This function take a list of community matrices and returns the central tendency and the confidence interval for each diversity index of interest across that list of communities.
calc_comm_div_ci(
samples,
cent_stat = "median",
ci = c(0.025, 0.975),
index,
effort = NA,
extrapolate = TRUE,
return_NA = FALSE,
rare_thres = 0.05,
scales = c("alpha", "gamma", "beta"),
PIE_replace = FALSE,
C_target_gamma = NA,
...
)
samples |
a list of community matrices (i.e., the output of |
cent_stat |
a string that is either 'mean' or 'median' which specifies the measure of central tendency. Defaults to 'median'. |
ci |
a numeric vector of two numbers specifying the lower and upper quantiles of the distribution to return. The default is to report the 0.025 and 0.975 quantiles in other words a 95 percent interval. |
index |
The calculated biodiversity indices. The options are
See Details for additional information on the biodiversity statistics. |
effort |
The standardized number of individuals used for the calculation of rarefied species richness. This must be a single integer. |
extrapolate |
Boolean which specifies if richness should be extrapolated when effort is larger than the number of individuals using the chao1 method (Chao 1984, 1987). Defaults to TRUE. |
return_NA |
Boolean in which the rarefaction function returns the
observed S when |
rare_thres |
The threshold that determines how the metric
|
scales |
The scales to compute the diversity indices for:
Defaults to all three scales: |
PIE_replace |
Used for |
C_target_gamma |
When computing coverage based richness ( |
... |
additional arguments that can be passed to |
The measure of central tendency can be the median (default) or mean, and the range of the confidence interval can be specified but defaults to a 95 confidence interval.
a data.frame that has the lower, middle, and upper quantiles of the sampled distribution of each diversity index.
get_samples
for generating samples, and calc_comm_div
for the calculation of diversity indices.
data(tank_comm)
samples <- get_samples(tank_comm, algo = 'loo')
calc_comm_div_ci(samples, index = 'S_PIE')
samples <- get_samples(tank_comm, algo = 'boot', n_boot = 20)
calc_comm_div_ci(samples, index = 'S_PIE')
# compute ci for average diversity (rather than median)
calc_comm_div_ci(samples, index = 'S_PIE', cent_stat = 'avg')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.