get_locations: Extract LOCATION information from CFDBS

View source: R/get_locations.R

get_locationsR Documentation

Extract LOCATION information from CFDBS

Description

Extract a list of lat, long, ten minute square, etc from the NEFSC "loc" supporting table

Usage

get_locations(channel, sqlStatement = "select * from cfdbs.loc;")

Arguments

channel

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

sqlStatement

Character string. An sql statement (optional)

Value

A list is returned:

locations

containing the result of the executed sqlStatement

sql

containing the sqlStatement itself

colNames

a vector of the table's column names

If no sqlStatement is provided the default sql statement "select * from cfdbs.loc" 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_ports(), get_species_itis(), get_species(), get_vessels()

Examples

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

# extracts subset of location information. Statistical area, and 10 minute square based on custom sql statement
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
sqlStatement <- "select area TENMSQ from cfdbs.loc;"
get_locations(channel,sqlStatement)

# extracts 10 minute square info for an area on geaorges bank (511) based on custom sql statement
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
sqlStatement <- "select area, tenmsq  from cfdbs.loc where area=511;"
get_locations(channel,sqlStatement)

## End(Not run)


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