iphc_data: Get IPHC data

iphc_dataR Documentation

Get IPHC data

Description

Get IPHC data

Usage

get_iphc_sets(species, usability = NULL)

get_iphc_sets_info()

get_iphc_skates_info()

get_iphc_hooks(species, usability = NULL)

cache_pbs_data_iphc(species, file_name = NULL, path = ".", compress = FALSE)

Arguments

species

One or more species common names (e.g. "pacific ocean perch") or one or more species codes (e.g. 396). Species codes can be specified as numeric vectors ⁠c(396, 442⁠) or characters c("396", "442"). Numeric values shorter than 3 digits will be expanded to 3 digits and converted to character objects (1 turns into "001"). Species common names and species codes should not be mixed. If any element is missing a species code, then all elements will be assumed to be species common names.

usability

A vector of usability codes to include. Defaults to all. IPHC codes may be different to other surveys.

file_name

Optional filename(s) for the cached file. Defaults to the same as the species argument.

path

The folder where the cached data will be saved.

compress

Compress the .rds file? Defaults to FALSE for faster reading and writing at the expense of disk space.

Details

  • get_iphc_sets() extracts IPHC survey data at the set level for given species, from 2003 to present (excluding 2013 and any later years that are not in database)

  • get_iphc_sets_info() extracts IPHC survey data regarding each set, with no species information, to give one unique row (with lat, lon etc.) for each set, from 2003 to present (excluding 2013 and others not in database)

  • get_iphc_skates_info() extracts IPHC survey data regarding each skate, with no species information, to give one unique row (with lat, lon etc.) for each set, from 2003 to present (excluding 2013 and otheres not in database); needed for the hooks per skate

  • get_iphc_hooks() extracts IPHC survey data at the hook level for given species, from 2003 to present (excluding 2013 and others not in database). If species is 'hook with bait' then it returns the hooks that were returned with bait.

  • cache_pbs_data_iphc() runs get_all_iphc_set_counts() for a given species and caches extracted data to a given folder

This cache_pbs_data_iphc() function caches the data for the given species from get_all_iphc_set_counts()

Value

The get_all_iphc_set_counts() function returns a data frame. The cache_pbs_data_iphc() function writes an .rds file to path for each specified species. A data object for a single species is a named list object with one element containing the data frame from get_all_iphc_set_counts(). The element name of the list is set_counts.

Examples

## Not run: 
cache_pbs_data_iphc("redbanded rockfish")
cache_pbs_data_iphc(c("redbanded rockfish",
                      "pacific ocean perch"),
                    path = "two-rockfish")

## End(Not run)

pbs-assess/gfiphc documentation built on July 4, 2023, 1:13 p.m.