get_age_length: Extract Length at Age data CFDBS

View source: R/get_age_length.R

get_age_lengthR Documentation

Extract Length at Age data CFDBS

Description

Extract a list of length and ages for speices sampled in Commercial fisheries data. This data is extracted from ADIOS (MV_CF_AGE)

Usage

get_age_length(
  channel,
  year = 1994,
  species = "all",
  species_itis = FALSE,
  sex = "all",
  area = "all"
)

Arguments

channel

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

species

A specific species code or set of codes. Either numeric or character vector. Defaults to "all" species. Numeric codes are converted to VARCHAR2(3 BYTE) when creating the sql statement. Character codes are short character strings.

sex

Character vector. Default = "all". options "M" (male), "F" (female), "U" (unsexed)

area

Character or numeric vector. Statistical areas from which to pull ages. Default = "all"

Value

A list is returned:

data

containing the result of the executed $sql statement

sql

containing the sql call

colNames

a vector of the table's column names

The default sql statement "select * from stockeff.mv_cf_age" is used

Reference

Use the data dictionary (http://nova.nefsc.noaa.gov/datadict/) for field name explanations. Note: species codes (nespp3) are stored in the database as VARCHAR2(3 BYTE)

See Also

connect_to_database

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

Examples

## Not run: 
# extracts all length and age data for all species defined as male or female (unsexed not included)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_length_age(channel,sex=c("M","F"))

# extracts info for cod (081) 
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_length_age(channel,species=81)

# extracts info for cod ("COD") 
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_length_age(channel,"cod") or
get_length_age(channel,"co") or
get_length_age(channel,"COD")


## End(Not run)


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