Skip to contents

Wrapper function to filter_observations() which filters species observations from biodiversity surveys, based on specified criteria. Subsequently forms community matrix, and removes taxon group-level (genus/family) if all species within group are observed in the area (& period), using the function check_taxongrps(). Finally, runs the function specaccum() in package vegan, and extracts output data. Data on both the biodiversity surveys and their species observations (and respective abundances) must be provided.

Usage

calculate_sac(
  observations,
  survey_ref,
  specify_area,
  specify_period,
  specify_taxon,
  survey_id = "survey_id",
  area = "area",
  period = "period",
  taxon = "taxon",
  species = "species",
  genus = "genus",
  family = "family",
  abundance = "abundance"
)

Arguments

observations

Dataframe of species observations. It should include columns for survey_id, area, period, taxon, species and abundance.

survey_ref

Dataframe of all surveys conducted. Values in the column survey_id should correspond to those in the observations.

specify_area

Specify the area.

specify_period

Specify the survey period.

specify_taxon

Specify the taxon group of interest.

survey_id

Column name of the unique identifier for each survey in observations and survey_ref. Defaults to survey_id.

area

Column name of the area specified in observations and survey_ref. Defaults to area.

period

Column name of the sampling period specified in observations and survey_ref. Defaults to period.

taxon

Column name of the taxon of interest specified in observations and survey_ref. Defaults to taxon.

species

Column name of the species specified in observations. Defaults to species.

genus

Column name of the genus specified in observations. Defaults to genus. Used to remove genus-level records in the species column, if all species within the group are observed within the filtered dataset.

family

Column name of the family specified in observations. Defaults to family. Used to remove family-level records in the species column, if all species within the group are observed within the filtered dataset.

abundance

Column name of the species abundance specified in observations. Defaults to abundance.

Value

A dataframe with columns for the sites, species richness and sd (standard deviation) of results, as well as the information specified in specify_area, specify_period and specify_taxon.