q_fsh_length.Rd
query fishery length data from the AKFIN server
q_fsh_length(
year,
species,
area,
db,
add_fields = NULL,
print_sql = FALSE,
save = TRUE
)
max year to retrieve data from
3 digit species codes (e.g., 201) - can place multiple in a vector c(201, 131)
bs, ai, goa, or hwc, wc, hg, hbs - can do multiples c("bs","ai")
data server to connect to (akfin)
add other columns to the database (must currently exist on server). "*" will return all table columns available
outputs the sql query instead of calling the data (default: false)
saves a file to the data/raw folder, otherwise sends output to global enviro (default: true)
saves fishery length data as data/raw/fish_length_data.csv or outputs to the global environment, also saves a copy of the SQL code used for the query and stores it in the data/sql folder.
if (FALSE) {
db <- afscdata::connect("akfin")
q_fsh_length(year=2022, species=301, area="goa", db=db)
}