get_areas: Extract AREA information from CFDBS

View source: R/get_areas.R

get_areasR Documentation

Extract AREA information from CFDBS

Description

Extract a list of statistical areas, region, NAFO codes, etc from the NEFSC "Area" supporting table

Usage

get_areas(channel, areas = "all")

Arguments

channel

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

areas

a specific area code or set of codes. Either numeric or character vector. Defaults to "all" areas Numeric codes are converted to VARCHAR2(3 BYTE) when creating the sql statement. Character codes are short character strings to reference the AREANM field.

Value

A list is returned:

areas

containing the result of the executed sqlStatement

sql

containing the sql call

colNames

a vector of the table's column names

The default sql statement "select * from cfdbs.area" is used

Reference

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

See Also

connect_to_database

Other get functions: get_age_length(), get_anything_sql(), 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 complete area table based on default sql statement
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_areas(channel)

# extracts a subset of area data based on selected areas 100,500 (numeric)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_areas(channel,areas=c(100,500))

# extracts a subset of area data based on selected areas 100,500 (character)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_areas(channel,areas=c("100","500"))

# extracts a subset of area data based on areanm's containing "GG" (Androscoggin River etc)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_areas(channel,"GG")


## End(Not run)


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