| Hdash | R Documentation |
Hdash() matches a list of species counts with the AMBI species list
and calculates H' the Shannon diversity index.
(Shannon, 1948)
Hdash(
df,
by = NULL,
var_species = "species",
var_count = "count",
check_species = TRUE,
df_species = NULL
)
df |
a dataframe of species observations |
by |
a vector of column names found in |
var_species |
name of the column in |
var_count |
name of the column in |
check_species |
boolean, default = TRUE. If TRUE, then only species found in the species list are included in H' index. By default, the AZTI species list is used. |
df_species |
optional dataframe with user-specified species list. |
If the function is called with the argument check_species = TRUE then
only species which are successfully matched with the specified species
list are included in the calculations. This is the default. If the function
is called with check_species = FALSEthen all rows are counted.
a list of two dataframes:
H : results of the AMBI index calculations. For each unique
combination of byvariables the following values are calculated:
H : the Shannon diversity Index, H'
S : the number of species
N : the number of individuals
match : the original dataframe with columns added from the species list.
For a user-specified list provided df_species, all columns will be included.
If the user-specified species list contains only a single column with species
names, then a new column match will be created, with a value of 1 indicating
a match and an NA value where no match was found.
For the default AZTI species list the following additional columns will be included:
group : showing the AMBI species group
RA : indicating that the species is reallocatable according to the
AZTI list. That is, it could be re-assigned to a different species group.
Shannon, C. E. (1948) "A mathematical theory of communication," in The Bell System Technical Journal, vol. 27, no. 3, pp. 379-423. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi:10.1002/j.1538-7305.1948.tb01338.x")}
Hdash(test_data, by=c("station"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.