margalef: Calculates Margalef's Species Richness

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/margalef.R


This function calculates Margalef's Species Richness for j areas and i years.


margalef(X, groups, species.table = NULL, metric = "ABUNDANCE", years)



A dataframe of fishery independent data derived from research vessel survey data or model output, with columns YEAR, ID, SPECIES, and ABUNDANCE. YEAR indicates the year the observation was recorded, ID is an area code indicating where the observation was recorded, SPECIES is a numeric code indicating the species sampled, and ABUNDANCE is the corresponding abundance (stratified and corrected for catchability as required).


A vector indicating the species group(s) for which to calculate the indicator. If groups = "ALL", all species will be included; otherwise, each entry must be a character string matching the name of a column in species.table.


A table where the column names match the entries in groups. Column entries are species codes indicating the species from X included in each group. species.table may also include columns for other species groups; these will be ignored. If groups = "ALL", this table is not required. Default is species.table = NULL.


A character string indicating which column in X to use to calculate the indicator. Default is metric = "ABUNDANCE".


A vector of years for which to calculate indicator.


Margalef's Species Richness:

S_{Marg} = (S_y - 1)/log(F_y)

S_y is the count of the number of species recorded in all trawl catches collected in year y. F is the total count of all individuals caught in year y (Margalef, 1958).


Returns a dataframe with columns ID and YEAR, and a column MargalefRichness_group for each entry in groups.

If there is no data for spatial scale j in year i, indicator values is assigned NA.


Danielle Dempsey, Adam Cook, Catalina Gomez, Alida Bundy


Bundy A, Gomez C, Cook AM. 2017. Guidance framework for the selection and evaluation of ecological indicators. Can. Tech. Rep. Fish. Aquat. Sci. 3232: xii + 212 p.

Margalef R. 1958. Information theory in ecology. General Systems 3, 36–71.

See Also

Other biodiversity indicators: allBiodiversity, heips, hillN1, hillN2, kemptonQ, pielouEvenness, shannon, speciesRichness


margalef(X, groups = c("ALL", "GROUNDFISH"), metric= "ABUNDANCE", years = c(2014:2019))

Example output

      ID YEAR MargalefRichness_ALL MargalefRichness_GROUNDFISH
1  AREA1 2014             6.197670                          NA
2  AREA1 2015             7.702378                          NA
3  AREA1 2016             7.717426                          NA
4  AREA1 2017             8.265226                          NA
5  AREA1 2018             7.754668                          NA
6  AREA1 2019             7.842566                          NA
7  AREA2 2014             6.726931                          NA
8  AREA2 2015             6.420818                          NA
9  AREA2 2016             6.376422                          NA
10 AREA2 2017             6.143174                          NA
11 AREA2 2018             5.850146                          NA
12 AREA2 2019             6.054704                          NA

marindicators documentation built on Nov. 12, 2019, 5:07 p.m.