Learn R Programming

vectorsurvR (version 1.6.1)

getAbundance: Calculate abundance

Description

Calculates abundance with option for filtering data and grouping results

Usage

getAbundance(
  collections,
  interval,
  agency = NULL,
  species = NULL,
  trap = NULL,
  sex = "female",
  trapnight_min = 1,
  trapnight_max = NULL,
  separate_by = NULL
)

Value

A dataframe of abundance calculations.

Arguments

collections

Collections data retrieved from getArthroCollections()

interval

Calculation interval for abundance, accepts "CollectionDate","Week", "Biweek", or "Month.

agency

An optional vector for filtering agency by character code

species

Character vector for filtering species. View species in your data `unique(data$species_display_name)`. Defaults to all species if no selection

trap

Character vector for filtering trap type by acronym. View trap types in your data`unique(data$trap_acronym`. Defaults to all trap types

sex

Character vector for filtering sex type. View sex options `unique(data$sex_type`). Defaults to "female".

trapnight_min

Minimum trap night restriction for calculation. Default is 1.

trapnight_max

Maximum trap night restriction for calculation. Default is no restriction.

separate_by

Separate/group the calculation by 'trap','species', 'agency', 'county', or 'spatial'. Default NULL does not separate.

Examples

Run this code
getAbundance(sample_collections,
             interval = 'Week',
             species = list('Cx pipiens'),
             trap = list('GRVD', 'CO2'),
             sex = list("female"),
             trapnight_min = 1,
             trapnight_max = 5,
             separate_by  = "species")

Run the code above in your browser using DataLab