R/profile_similarity.R
profile_similarity.Rd
Calculate the diversity profile of a community, i.e. its similarity-based diversity against its order.
profile_similarity(
x,
similarities,
orders = seq(from = 0, to = 2, by = 0.1),
...
)
# S3 method for class 'numeric'
profile_similarity(
x,
similarities = diag(length(x)),
orders = seq(from = 0, to = 2, by = 0.1),
estimator = c("UnveilJ", "Max", "ChaoShen", "MarconZhang", "UnveilC", "UnveiliC",
"naive"),
probability_estimator = c("Chao2015", "Chao2013", "ChaoShen", "naive"),
unveiling = c("geometric", "uniform", "none"),
richness_estimator = c("jackknife", "iChao1", "Chao1", "naive"),
jack_alpha = 0.05,
jack_max = 10,
coverage_estimator = c("ZhangHuang", "Chao", "Turing", "Good"),
sample_coverage = NULL,
as_numeric = FALSE,
n_simulations = 0,
alpha = 0.05,
bootstrap = c("Chao2015", "Marcon2012", "Chao2013"),
show_progress = TRUE,
...,
check_arguments = TRUE
)
# S3 method for class 'species_distribution'
profile_similarity(
x,
similarities = diag(sum(!colnames(x) %in% non_species_columns)),
orders = seq(from = 0, to = 2, by = 0.1),
estimator = c("UnveilJ", "Max", "ChaoShen", "MarconZhang", "UnveilC", "UnveiliC",
"naive"),
probability_estimator = c("Chao2015", "Chao2013", "ChaoShen", "naive"),
unveiling = c("geometric", "uniform", "none"),
jack_alpha = 0.05,
jack_max = 10,
coverage_estimator = c("ZhangHuang", "Chao", "Turing", "Good"),
gamma = FALSE,
n_simulations = 0,
alpha = 0.05,
bootstrap = c("Chao2015", "Marcon2012", "Chao2013"),
show_progress = TRUE,
...,
check_arguments = TRUE
)
An object, that may be a numeric vector containing abundances or probabilities, or an object of class abundances or probabilities.
A similarity matrix, that can be obtained by fun_similarity. Its default value is the identity matrix.
The orders of diversity used to build the profile.
Unused.
An estimator of entropy.
A string containing one of the possible estimators of the probability distribution (see probabilities). Used only for extrapolation.
A string containing one of the possible unveiling methods to estimate the probabilities of the unobserved species (see probabilities). Used only for extrapolation.
An estimator of richness to evaluate the total number of species, see div_richness. Used for interpolation and extrapolation.
The risk level, 5% by default, used to optimize the jackknife order.
The highest jackknife order allowed. Default is 10.
An estimator of sample coverage used by coverage.
The sample coverage of x
calculated elsewhere.
Used to calculate the gamma diversity of meta-communities, see details.
If TRUE
, a number or a numeric vector is returned rather than a tibble.
The number of simulations used to estimate the confidence envelope of the profile.
The risk level, 5% by default, of the confidence envelope of the profile.
The method used to obtain the probabilities to generate bootstrapped communities from observed abundances. If "Marcon2012", the probabilities are simply the abundances divided by the total number of individuals Marcon2012adivent. If "Chao2013" or "Chao2015" (by default), a more sophisticated approach is used (see as_probabilities) following Chao2013;textualdivent or Chao2015;textualdivent.
If TRUE, a progress bar is shown during long computations.
If TRUE
, the function arguments are verified.
Should be set to FALSE
to save time when the arguments have been checked elsewhere.
If TRUE
, \(\gamma\) diversity, i.e. diversity of the metacommunity, is computed.
A tibble with the site names, the estimators used and the estimated diversity at each order. This is an object of class "profile" that can be plotted.
A bootstrap confidence interval can be produced by simulating communities
(their number is n_simulations
) with rcommunity and calculating their profiles.
Simulating communities implies a downward bias in the estimation:
rare species of the actual community may have abundance zero in simulated communities.
Simulated diversity values are recentered so that their mean is that of the actual community.
# Similarity matrix
Z <- fun_similarity(paracou_6_fundist)
# Profile
profile_similarity(paracou_6_abd, similarities = Z, q = 2)
#> # A tibble: 84 × 4
#> site estimator order diversity
#> <chr> <chr> <dbl> <dbl>
#> 1 subplot_1 UnveilJ 0 1.31
#> 2 subplot_1 UnveilJ 0.1 1.31
#> 3 subplot_1 UnveilJ 0.2 1.31
#> 4 subplot_1 UnveilJ 0.3 1.31
#> 5 subplot_1 UnveilJ 0.4 1.31
#> 6 subplot_1 UnveilJ 0.5 1.31
#> 7 subplot_1 UnveilJ 0.6 1.31
#> 8 subplot_1 UnveilJ 0.7 1.31
#> 9 subplot_1 UnveilJ 0.8 1.31
#> 10 subplot_1 UnveilJ 0.9 1.31
#> # ℹ 74 more rows