get_ports: Extract PORT location information from CFDBS

View source: R/get_ports.R

get_portsR Documentation

Extract PORT location information from CFDBS

Description

Extract a list of port names, and location info for vessel landings from the NEFSC "Port" supporting table

Usage

get_ports(channel, ports = "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)

ports

a specific port code or set of codes. Either numeric or character vector. Defaults to "all" ports. Numeric codes are converted to VARCHAR2(6 BYTE) when creating the sql statement. Character codes are short character strings referencing PORTNM field.

Value

A list is returned:

species

containing the result of the executed sqlStatement

sql

containing the sql call

colNames

a vector of the table's column names

If no sqlStatement is provided the default sql statement "select * from cfdbs.port" 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_areas(), get_gears(), get_landings_length(), get_landings_palmer(), get_landings(), get_locations(), get_species_itis(), get_species(), get_vessels()

Examples

## Not run: 
# extracts complete port table based on default sql statement
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_ports(channel)

# extracts port details based on ports 224309 , 224409 (numeric)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_ports(channel,ports = c(224309,224409))

# extracts port details based on ports 224309 , 224409 (character)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_ports(channel,ports = c("224309","224409"))

# extracts port details based on port name (character)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_ports(channel,ports = "Fairfield") or 
get_ports(channel,ports = "Fair")


## End(Not run)


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