canada_extract_samples_from_db: Extract the Canadian biological sample data

View source: R/utils-canada-extract-samples-from-db.R

canada_extract_samples_from_dbR Documentation

Extract the Canadian biological sample data

Description

Extract the Canadian biological sample data from the GFBIOSQL database The data frame returned will be raw and unfiltered

Usage

canada_extract_samples_from_db(
  dr = "/srv/hake/other/samples",
  ret_df = FALSE,
  overwrite = FALSE,
  unsorted_only = FALSE,
  species_code = 225
)

Arguments

dr

The directory to save the samples RDS file in

ret_df

Logical. If TRUE, return the data frame from the function and do not write a csv file. If FALSE, write the csv file and return nothing

overwrite

Logical. Overwrite the RDS file for sample data if it exists

unsorted_only

Only include unsorted samples. For hake in Canada, this needs to be FALSE or some years will show no ages at all. See gfdata::get_commercial_samples() for additional information

species_code

The DFO Groundfish database species code; default: 225 (hake)

Value

If ret_df is TRUE, return the sample data frame. If ret_df is FALSE, return nothing, write an RDS file instead


pacific-hake/hake-assessment documentation built on July 21, 2024, 8:19 a.m.