Learn R Programming

codyn (version 2.0.5)

turnover: Species Turnover

Description

Computes species turnover between time periods as the proportion of species either gained or lost relative to the total number of species observed across both time periods. Includes an option to compute turnover as just the proportion of species gained (i.e., "appearances") or lost (i.e., "disappearances").

Usage

turnover(
  df,
  time.var,
  species.var,
  abundance.var,
  replicate.var = NA,
  metric = "total"
)

Arguments

df

A data frame containing time, species and abundance columns and an optional column of replicates

time.var

The name of the time column

species.var

The name of the species column

abundance.var

The name of the abundance column

replicate.var

The name of the optional replicate column

metric

The turnover metric to return:

  • total: The default metric, calculates summed appearances and disappearances relative to total species richness across both time periods.

  • appearance: Calculates the number of species that appeared in the second time period relative to total species richness across both time periods.

  • disappearance: Calculates the number of species that disappeared in the second time period relative to total species richness across both time periods.

Value

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

  • turnover: A numeric column with the turnover values. The name of this column is the same as the specified metric (default is "total").

  • time.var: A column containing the second time point; the name and type of this column is the same as the time.var column in the input dataframe.

  • replicate.var: A column that has same name and type as the replicate.var column, if replication is specified.

Details

The input data frame needs to contain columns for time, species and abundance; time.var, species.var and abundance.var are used to indicate which columns contain those variables. If multiple replicates are included in the data frame, that column should be specified with replicate.var. Each replicate should reflect a single experimental unit - there must be a single abundance value per species within each time point and replicate.

References

Cleland, Elsa E., Scott L. Collins, Timothy L. Dickson, Emily C. Farrer, Katherine L. Gross, Laureano A. Gherardi, Lauren M. Hallett, et al. (2013) "Sensitivity of grassland plant community composition to spatial vs. temporal variation in precipitation." Ecology 94, no. 8: 1687-96.

Examples

Run this code
# NOT RUN {
 data(knz_001d)

 # Calculate relative total turnover within replicates
 total.res <- turnover(df=knz_001d,  
               time.var = "year", 
               species.var = "species",
               abundance.var = "abundance", 
               replicate.var="subplot")
 
 # Calculate relative species appearances within replicates
 appear.res <- turnover(df=knz_001d, 
               time.var = "year", 
               species.var = "species",
               abundance.var = "abundance",  
               replicate.var="subplot", 
               metric="appearance")
 
 # Calculate relative species disappearances within replicates
 disappear.res <- turnover(df=knz_001d, 
               time.var = "year", 
               species.var = "species",
               abundance.var = "abundance", 
               replicate.var="subplot", 
               metric="disappearance")
 
# }

Run the code above in your browser using DataLab