get_landings_palmer: Extract landings data from ADIOS! (help from CFDBS)

View source: R/get_landings_palmer.R

get_landings_palmerR Documentation

Extract landings data from ADIOS! (help from CFDBS)

Description

Extract landings information (trplndlb,trplivlb,spplndlb,spplivlb) in lbs from the databse ADIOS! This function requires no knowledge of sql. NOTE: Eventually hope to pull numlen, and len also. This resides in a different table in ADIOS For direct sql usage please see get_anything_sql function

Usage

get_landings_palmer(
  channel,
  area = "all",
  gear = "all",
  year = 1994,
  tonnage = "all",
  species = "all",
  gearCode = "NEGEAR2",
  species_itis = FALSE
)

Arguments

channel

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

tonnage

Numeric vector. Tonnage classes (toncl2) (1 - 8) where 1 = 10-19 tons, 2 = 20-29 tons etc

species

Numeric vector. Species codes (nespp3 or species_itis)

gearCode

Character string. Relates to the codes supplied in gears. Either "NEGEAR" or "NEGEAR2".

species_itis

Boolean. Indicating if species values are nespp3 (FALSE) or species_itis (TRUE).Default = FALSE

areas

Numeric vector. Statistical areas (area)

gears

Numeric vector. Gear types (negear2)

years

Numeric vector. Containing the years to search over

Value

A list is returned:

data containing the result of the data pull (year, month, day, negear, negear2, toncl2, nespp3, nespp4, species_itis, market_code, area, ntrips, mesh, df, da, spplndlb, spplivlb, trplndlb, trplivlb, GIS_LAT, GIS_LON )

sql the resulting sql statement based on user input

colNames a vector of the table's column names

Reference

Use the data dictionary (http://nova.nefsc.noaa.gov/datadict/) for field name explanations

Warning

You will need to obtain read only privilages to access ADIOS! The ADIOS landings database (MV_CF_Landings) contains 35 million records. If you try to pull the entire database it is likely you will run out of memory.

See Also

connect_to_database

Other get functions: get_age_length(), get_anything_sql(), get_areas(), get_gears(), get_landings_length(), get_landings(), get_locations(), get_ports(), get_species_itis(), get_species(), get_vessels()

Examples

## Not run: 

# extracts landings for cod (081) in area 500 for ton class >=10 by <20 using  gear types (1,2,10)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")

get_landings(channel,area=c(500,600),gear=c(1,2,10),year=c(1999),tonnage=c(1),species=81)

## End(Not run)


andybeet/cfdbs documentation built on Sept. 19, 2023, 9:34 p.m.