Learn R Programming

vectorsurvR (version 1.6.1)

getSpeciesTable: Get Table For Species

Description

Allows users to create a custom table for vector species. The invasive species count, trap nights, and abundance are calculated by chosen groupings or time intervals. The table has output options based on document format.

Usage

getSpeciesTable(
  token,
  interval,
  target_year,
  cumulative = FALSE,
  include_trap_nights = TRUE,
  include_abundance = FALSE,
  species = NULL,
  trap = NULL,
  sex = "female",
  separate_by = NULL,
  output_format = "auto",
  caption = NULL,
  agency_id = NULL
)

Value

A table displaying invasive species interval or/and cumulative counts over time

Arguments

token

Authentication token for API access, obtained from `getToken()`

interval

Time interval for aggregation. One of: "CollectionDate", "Week", "Biweek", "Month"

target_year

The focal year to highlight in the plot (integer)

cumulative

T/F Adds columns for the cumulative sum count Default to FALSE

include_trap_nights

T/F Adds column for the tally of trap nights

include_abundance

T/F Adds column for abundance (non-cumulative only)

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".

separate_by

Adds a column from the data as a grouping variable. Accepts 'site', 'city', 'county', 'agency', 'trap', 'spatial'

output_format

Format to output table display. Accepts 'html', 'pdf', 'word' or 'auto'. Default auto returns the console format dataframe.

caption

Caption for table

agency_id

Agency identifier to filter data if applicable