Skip to contents

This function scrapes MRIP catch data from the MRIP Query tool and saves it as an Rds. Used as a helper function to automate data pulls.

Usage

save_catch(
  this_species,
  this_region,
  out_folder,
  catch_type = "all",
  this_data_type,
  wait = TRUE,
  return_fname = TRUE
)

Arguments

this_species

the common name of the species as it appears in the MRIP data. capitalization does not matter.

out_folder

where to save the data

catch_type

the type of catch to query. Can be "all" for all catch types (A, B1, B2), or "landings" for just the landings (A and B1). Default is "all".

wait

whether to pause after saving the data. Default is TRUE.

return_fmane

whether to return the file name of the saved data. Default is TRUE.

Value

Saves list of the scraped data and metadata. Returns the file name.