Skip to contents

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 and abundance.

survey_ref

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

level

Specify whether to tally by 'survey' or 'point' (character). Defaults to 'point'.

specify_taxon

Specify the taxon of interest (character). Defaults to NULL, which includes all taxa.

specify_area

Specify the area (character). Defaults to NULL, which includes all areas.

specify_period

Specify the survey period (character). Defaults to NULL, which includes all periods.

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.

point_id

Column name of the unique identifier for each sampling point specified in observations and survey_ref. Defaults to point_id.

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 containing the tally of species per survey/sampling point (depends if level ='survey' or 'point').