community_structure {codyn}R Documentation

Community Structure

Description

Calculates species richness and evenness of a community. Evenness may be calculated as Simpson's (1/D/S), EQ, or Evar, but only one metric of evenness can be calculated at a time and must be specified.

Usage

community_structure(
  df,
  time.var = NULL,
  abundance.var,
  replicate.var = NULL,
  metric = c("Evar", "SimpsonEvenness", "EQ")
)

Arguments

df

A data frame containing species and abundance columns and optional columns of time and/or replicate.

time.var

The name of the optional time column

abundance.var

The name of the abundance column

replicate.var

The name of the optional replicate column. If specified, replicate must be unique within the dataset and cannot be nested within treatments or blocks.

metric

The measure of evenness to return:

  • "Evar": The default measure, calculates evenness as Evar from Smith and Wilson 1996

  • "SimpsonEvenness": Calculates Simpson's evenness

  • "EQ": Calculates evenness as EQ from Smith and Wilson 1996

Value

The community_structure function returns a data frame with the following attributes:

References

Smith, B. and Wilson, J. B. 1996. A consumer's guide to evenness indices. Oikos 76: 70-82.

Examples

data(pplots)
#Example with both time and replicates
df <- subset(pplots, plot == 25 | plot == 6)
community_structure(df, 
                    time.var="year", 
                    replicate.var = "plot", 
                    abundance.var = "relative_cover") # for Evar evenness measure

df <- subset(pplots, plot == 25 | plot == 6)
community_structure(df,
                    time.var="year", 
                    replicate.var = "plot", 
                    abundance.var = "relative_cover", 
                    metric = "SimpsonEvenness") # for Simpson's evenness measure

#Example with no replicates
df <- subset(pplots, plot == 25)
community_structure(df, 
                    time.var="year", 
                    abundance.var = "relative_cover",
                    metric = "EQ") # for EQ evenness measure

#Example with only a single time point and no replicates
df <- subset(pplots, plot == 25 & year == 2002)
community_structure(df, 
                    abundance.var = "relative_cover") # for Evar evenness measure

[Package codyn version 2.0.5 Index]