pull_gemm: Pull gemm data from the NWFSC data warehouse The website is:...

View source: R/pull_gemm.R

pull_gemmR Documentation

Pull gemm data from the NWFSC data warehouse The website is: https://www.webapps.nwfsc.noaa.gov/data This function can be used to pull all gemm data, a single species, or a subset of species c("Canary Rockfish", "Widow Rockfish"). Species names in the gemm are capitalized (e.g. Canary Rockfish). However, there are checks in the function to adjust input species names if the input names do not match the expected capitalization (e.g. "canary rockfish", "canary_rockfish"). The fuction also allows you to subset the data by year using the years input and to save the object if the dir function input is given.

Description

Pull gemm data from the NWFSC data warehouse The website is: https://www.webapps.nwfsc.noaa.gov/data This function can be used to pull all gemm data, a single species, or a subset of species c("Canary Rockfish", "Widow Rockfish"). Species names in the gemm are capitalized (e.g. Canary Rockfish). However, there are checks in the function to adjust input species names if the input names do not match the expected capitalization (e.g. "canary rockfish", "canary_rockfish"). The fuction also allows you to subset the data by year using the years input and to save the object if the dir function input is given.

Usage

pull_gemm(common_name, years, dir)

Arguments

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.

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 ouptut will be saved. The directory where the file should be saved. If dir = NULL no output will be saved.

Author(s)

Chantel Wetzel

Examples

## Not run: 
# Pull all GEMM data
all_data <- pull_gemm()

# Pull for a specific specis 
widow_data <- pull_gemm(common_name = "Widow Rockfish")

# Pull multiple species
data <- pull_gemm(common_name = c("Widow Rockfish", "Canary Rockfish"))

# Pull species and subset years
widow_recent <- pull_gemm(common_name = "Widow Rockfish", years = 2014:2019)

## End(Not run)



nwfsc-assess/nwfscSurvey documentation built on April 29, 2024, 9:51 p.m.