| alpha_div | R Documentation |
Alpha Diversity Wrapper Function
alpha_div(
counts,
metric,
norm = "percent",
cutoff = 10L,
digits = 3L,
tree = NULL,
margin = 1L,
cpus = n_cpus()
)
counts |
A numeric matrix of count data where each column is a
feature, and each row is a sample. Any object coercible with
|
metric |
The name of an alpha diversity metric. One of |
norm |
Normalize the incoming counts. Options are:
Default: |
cutoff |
The maximum number of observations to consider "rare".
Default: |
digits |
Precision of the returned values, in number of decimal
places. E.g. the default |
tree |
A |
margin |
If your samples are in the matrix's rows, set to |
cpus |
How many parallel processing threads should be used. The
default, |
A frequent and critical error in alpha diversity analysis is providing the wrong type of data to a metric's formula. Some indices are mathematically defined based on counts of individuals and require raw, integer abundance data. Others are based on proportional abundances and can accept either integer counts (which are then converted to proportions) or pre-normalized proportional data. Using proportional data with a metric that requires integer counts will return an error message.
Chao1
ACE
Squares Richness Estimator
Margalef's Index
Menhinick's Index
Fisher's Alpha
Brillouin Index
Observed Features
Shannon Index
Gini-Simpson Index
Inverse Simpson Index
Berger-Parker Index
McIntosh Index
Faith's PD
A numeric vector.
# Example counts matrix
ex_counts
# Shannon diversity values
alpha_div(ex_counts, 'Shannon')
# Chao1 diversity values
alpha_div(ex_counts, 'c')
# Faith PD values
alpha_div(ex_counts, 'faith', tree = ex_tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.