Grab commercial landings data from US and Foreign countries (NAFO) Need to fix menhaden data SML

comland(
  channel,
  GEARS = comlandr::GEARs,
  EPUS = comlandr::EPUs,
  use.existing = "y",
  landed = "y",
  foreign = "y",
  adjust.ppi = "y",
  sum.by = "EPU",
  endyear = 2018,
  reftime = c(2016, 1),
  out.dir = here::here(),
  Stand.alone = F
)

Arguments

channel

an Object inherited from DBIConnection-class. This object is used to connect to communicate with the database engine. (see connect_to_database)

GEARS

List. Designates the NEGEAR codes that comprise a fishing fleet. Default = GEARs (lazily loaded data)

EPUS

List. Designates the stat areas that comprise an EPU. Default = EPUs (lazily loaded data)

use.existing

String. Pull from database "n" or use existing pull "y" (saves time) . Default = "y"

landed

Character String. Use landed weight for scallops and clams or live weight. Default = "y" (meatwt), "n" (livewt)

foreign

Character String. Mark foreign landings and keep seperate. Default = "y"

adjust.ppi

Character String. Adjust value for inflation. Default = "y" (deflated) vs "n" (notdeflated)

sum.by

Character String. Variable to sum landings by either "EPU" (Default) or "stat.area"

endyear

Numeric Scalar. Final year of query. Default = 2018

reftime

Numeric Vector. (Length 2). Specifies the year and month if adjusting for inflation. Default = c(2016,1)

out.dir

Character string. Path to directory where final output will be saved or where data is to be read from

Stand.alone

Boolean. Flag to determine whether to save Skate and hake data to file. defualt = F (Both a US catch file and a NAFO catch file will be saved)

Value

An RDS file is created

A file will be written to your hard drive in the directory specified by out.dir. The name of the file will be named depending on user input. For example:

Filename = 'comland_meatwt_deflated_stat_areas.RDS' arises from user: landed = "y", adjust.ppi = "y", sum.by = "stat.area"