pull_catch: Pull catch data for satisfactory tows from the NWFSC data...

View source: R/pull_catch.R

pull_catchR Documentation

Pull catch data for satisfactory tows from the NWFSC data warehouse

Description

Pull catch data from the NWFSC data warehouse for a single species or all observed species, where the latter is specified by leaving both common_name = NULL and sci_name = NULL.

Usage

pull_catch(
  survey,
  common_name = NULL,
  sci_name = NULL,
  years = c(1970, 2050),
  dir = NULL,
  convert = TRUE,
  verbose = TRUE,
  sample_types = c("NA", NA, "Life Stage", "Size")[1:2],
  standard_filtering = TRUE
)

Arguments

survey

A character entry from one of the following options that specifies which survey to pull the data for. The input options are:

  • Triennial,

  • AFSC.Slope,

  • NWFSC.Combo,

  • NWFSC.Slope,

  • NWFSC.Shelf,

  • NWFSC.Hypoxia,

  • NWFSC.Santa.Barb.Basin,

  • NWFSC.Shelf.Rockfish (not yet working),

  • NWFSC.Hook.Line (not yet working),

  • NWFSC.Video,

  • Triennial.Canada

The National Marine Fishery Service Alaska Fisheries Science Center (AFSC) Triennial survey was conducted between 1977 - 2004 occurring every 3rd year. The initial year, 1977, survey is not traditionally used in calculating indices of abundance. The Triennial survey sampled areas within the Canadian EEZ on the West Coast of Vancouver Island in 1980 - 2001 but these data are associated with a different survey name "Triennial.Canada". The AFSC Slope Survey (AFSC.Slope) along the west coast of the U.S. began in 1984 and occurred annually from 1988-2001, with the exception of 1994 and 1998, when surveys were not conducted. Prior to 1997, only a limited portion of the coast was covered in each year. U.S. West Coast groundfish stock assessments only use the four years of consistent and complete survey coverage (1997, 1999-2001). The Northwest Fisheries Science Center (NWFSC) Slope survey (NWFSC.Slope) was conducted between 1998 - 2001. The NWFSC West Coast Groundfish Bottom Trawl survey (NWFSC.Combo) is conducted annualy starting in 2003 (excluding 2020) and samples both the U.S. west coast shelf and slope between 55 - 1,280 meters. Data can only be pulled from one survey at a time, though we are working on allowing for a vector of survey names. Currently, NWFSC.Shelf.Rockfish and NWFSC.Hook.Line are not supported.

common_name

A character entry with the desired common name of the species you want to pull data for from the data warehouse. Use a vector of names if you want information for more than one species or if the desired species is included in the database using more than one name, e.g., vermilion rockfish (see the example below). Use the sci_name argument if you know the latin name.

sci_name

A character entry with the desired scientific name of the species you want to pull data for from the data warehouse. Use a vector of names if you want information for more than one species or if the desired species is included in the database using more than one name, e.g., vermilion rockfish (see the example below). Use the common_name argument if you know the common name.

years

An integer vector of length two with the range of years to pull data for (e.g., c(2003, 2024)). Vector can not contain -Inf or Inf.

dir

Directory where output will be saved. The directory where the file should be saved. If dir = NULL no output will be saved.

convert

TRUE/FALSE to convert column names to first letter uppercase which aligns with the expected names in data processing functions.

verbose

A logical that specifies if you want to print messages and warnings to the console. The default is TRUE.

sample_types

A character vector of sample types, i.e., "statistical_partition_dim", that you would like to keep. The default is to only keep NA values, both real and character NA. But, for some instances you may want to keep Life Stage and Size samples. The majority of samples with "statistical_partition_dim" of Size and Life Stage are Pacific hake and should not be considered different than regular survey samples. The other types of samples that may be designated Life Stage are egg cases that can be caught and identified for select elasmobranch species. These type of samples should not be included in the data used to estimate indices of abundance and are omitted by default.

standard_filtering

A logical TRUE/FALSE that specifies whether data should be filtered using the standard filtering which removes tows with bad performance (water haul or poor net performance), or stations that have been removed from the survey sampling protocol.

Details

The data available in the warehouse are cleaned prior to being downloaded with the intent that they provide the best available information for use in an index-standardization procedure. The removed samples may be of use to others with a less-restrictive goal than producing an index of abundance. For example, depths sampled outside the standard protocol are excluded. To download all data, we currently recommend going to the NWFSC data warehouse and using the csv link to extract data for a single species at a time. In the future, we hope to add functionality to this package such that downloading all data can be done easily within this function.

Author(s)

Chantel Wetzel

Examples

## Not run: 
# survey is only arg that has to be specified
catch_data <- pull_catch(survey = "NWFSC.Combo")

# Example with specified common name
catch_data <- pull_catch(
  common_name = "vermilion rockfish",
  survey = "NWFSC.Combo"
)

# Example with specified scientific name
catch_data <- pull_catch(
  sci_name = "Eopsetta jordani",
  survey = "NWFSC.Combo"
)

# Example with multiple names
catch_data <- pull_catch(common_name = c(
  "vermilion rockfish",
  "vermilion and sunset rockfish"
), survey = "NWFSC.Combo")

catch_data <- pull_catch(
  sci_name = c(
    "Sebastes miniatus",
    "Sebastes sp. (crocotulus)",
    "Sebastes sp. (miniatus / crocotulus)"
  ),
  survey = "NWFSC.Combo"
)

## End(Not run)


nwfsc-assess/nwfscSurvey documentation built on Dec. 12, 2024, 9:01 p.m.