ES() matches a list of species counts with the AMBI species list
and calculates ES the Hurlbert diversity index, which gives the
expected sample species richness for a subsample of the population.
(Hurlbert, 1971)
Usage
ES(
df,
by = NULL,
var_species = "species",
var_count = "count",
check_species = TRUE,
df_species = NULL,
n = 100
)Arguments
- df
a dataframe of species observations
- by
a vector of column names found in
dfby which calculations should be grouped e.g. c("station","date")- var_species
name of the column in
dfcontaining species names- var_count
name of the column in
dfcontaining count/density/abundance- 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.
- n
subsample size, usually indicated in the abbreviated name for the index. e.g.
ES100is ES calculated with a subsample of 100 individuals (the default) The sampling is done for each by group.
Value
a list of two dataframes:
ES: results of the ES index calculations. For each unique combination ofbyvariables the following values are calculated:ES<n>: the expected sample species richness, ES for a sample sizenof 100, the variable name isES100S: the number of speciesN: the number of individuals
match: the original dataframe with columns added from the species list. For a user-specified list provideddf_species, all columns will be included. If the user-specified species list contains only a single column with species names, then a new columnmatchwill be created, with a value of1indicating a match and anNAvalue where no match was found.
For the default AZTI species list the following additional columns will be included:
group: showing the AMBI species groupRA: indicating that the species is reallocatable according to the AZTI list. That is, it could be re-assigned to a different species group.
Details
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.
References
Hurlbert, S.H. (1971), The Nonconcept of Species Diversity: A Critique and Alternative Parameters. Ecology, 52: 577-586. doi:10.2307/1934145
Examples
ES(test_data)
#> $ES
#> # A tibble: 1 × 4
#> ES100 N S warning
#> <dbl> <dbl> <int> <chr>
#> 1 31.1 120 34 NA
#>
#> $matched
#> # A tibble: 53 × 6
#> station replicate species count group RA
#> <dbl> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 1 a Cumopsis fagei 2 2 0
#> 2 1 a Diogenes pugilator 2 2 0
#> 3 1 a Paradoneis armata 1 3 0
#> 4 1 b Bathyporeia elegans 1 1 0
#> 5 1 b Diogenes pugilator 5 2 0
#> 6 1 b Dispio uncinata 1 3 0
#> 7 1 c Astarte sp. 1 1 0
#> 8 1 c Diogenes pugilator 3 2 0
#> 9 2 a Cumopsis fagei 1 2 0
#> 10 2 a Glycera tridactyla 2 2 0
#> # ℹ 43 more rows
#>
