Tally number of species observations based on specified criteria
Source:R/tally_observations.R
tally_observations.Rd
Wrapper function to filter_observations()
which filters species observations from biodiversity surveys, based on specified criteria.
Subsequently tallies the number of species per survey/sampling point (similar to function specnumber()
in package vegan
),
and extracts output data. If tallied at the level of sampling points (level = 'point'
),
removes taxon group-level (genus/family) if all species within group are observed at the point (& period),
using the function check_taxongrps()
. Data on both the biodiversity surveys and their species observations (and respective abundances)
must be provided.
Usage
tally_observations(
observations,
survey_ref,
level = "point",
specify_taxon = NULL,
specify_area = NULL,
specify_period = NULL,
survey_id = "survey_id",
area = "area",
period = "period",
taxon = "taxon",
point_id = "point_id",
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
.- level
Specify whether to tally by
'survey'
or'point'
(character). Defaults to'point'
.- specify_taxon
Specify the
taxon
of interest (character). Defaults toNULL
, which includes all taxa.- specify_area
Specify the
area
(character). Defaults toNULL
, which includes all areas.- specify_period
Specify the survey
period
(character). Defaults toNULL
, which includes all periods.- 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
.- point_id
Column name of the unique identifier for each sampling point specified in
observations
andsurvey_ref
. Defaults topoint_id
.- 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
.