get_catch_haul_history | R Documentation |
Find historical catch data from previous years
get_catch_haul_history(
survey,
species_codes = NA,
years = NA,
station,
grid_buffer = NA
)
survey |
(character) A character string of the survey you are interested in reivewing. Options are those from public_data$survey, which are "AI", "GOA", "EBS", "NBS", "BSS". |
species_codes |
(numeric) A species code number of a species or species you are specifically interested in reviewing data from. If NA/not entered, the function will return data for all species caught in the haul. |
years |
(numeric) the years you want returned in the output. If years = NA, script will default to the last 10 years. If you would like to see all years, simply choose a large range that covers all years of the survey (e.g., 1970:2030) |
station |
(character) A character string of the current station name (as a grid cell; e.g., "264-85") |
grid_buffer |
(numeric) GOA/AI only. The number of cells around the current station where you would like to see catches from. Typically, use grid_buffer = 3. |
a data.frame of past catches and hauls
#' # EBS (or NBS) --------------------------------------------------------------
## for one year and only 1 station for all species --------------------------
get_catch_haul_history(
survey = "EBS",
years = 2021,
station = "I-13")
## for default 10 years and only 1 station for PCOD and walleye pollock ----
get_catch_haul_history(
species_codes = c(21720, 21740), # pacific cod and walleye pollock
survey = "EBS",
station = "I-13")
# AI (or GOA) ---------------------------------------------------------------
## for two specific years and nearby stations -------------------------------
get_catch_haul_history(
survey = "AI",
years = c(2016, 2018),
station = "324-73",
grid_buffer = 3)
## for default 10 years and nearby stations for all species (a typical use-case) ----
get_catch_haul_history(
survey = "AI",
years = NA, # default
station = "324-73",
grid_buffer = 3)
## for default 10 years and nearby stations for Bering Flounder (0 results returned!) ---
get_catch_haul_history(
survey = "AI",
species_codes = 10140, # Bering flounder which would be VERY unlikely to be found
years = NA, # default
station = "324-73",
grid_buffer = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.