Extract species accumulation curves based on specified criteria
Source:R/calculate_sac.R
calculate_sac.Rd
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
andabundance
.- survey_ref
Dataframe of all surveys conducted. Values in the column
survey_id
should correspond to those in theobservations
.- 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
andsurvey_ref
. Defaults tosurvey_id
.- area
Column name of the area specified in
observations
andsurvey_ref
. Defaults toarea
.- period
Column name of the sampling period specified in
observations
andsurvey_ref
. Defaults toperiod
.- taxon
Column name of the taxon of interest specified in
observations
andsurvey_ref
. Defaults totaxon
.- species
Column name of the species specified in
observations
. Defaults tospecies
.- genus
Column name of the genus specified in
observations
. Defaults togenus
. Used to remove genus-level records in thespecies
column, if all species within the group are observed within the filtered dataset.- family
Column name of the family specified in
observations
. Defaults tofamily
. Used to remove family-level records in thespecies
column, if all species within the group are observed within the filtered dataset.- abundance
Column name of the species abundance specified in
observations
. Defaults toabundance
.