get_vessels: Extract VESSEL information from CFDBS

View source: R/get_vessels.R

get_vesselsR Documentation

Extract VESSEL information from CFDBS

Description

Extract a list of vessell ID's, tonnage, crew size, home port, etc from the NEFSC "Mstrvess" supporting table

Usage

get_vessels(
  channel,
  sqlStatement = "select * from cfdbs.mstrvess",
  where = NULL
)

Arguments

channel

an Object inherited from ROracle::Oracle. This object is used to connect to communicate with the database engine. (see dbutils::connect_to_database)

sqlStatement

an sql statement (optional)

where

text string appending where clause to sql

Value

A list is returned:

data

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.mstrvess" is used

Reference

Use the data dictionary for field name explanations

See Also

connect_to_database

Other get functions: get_areas(), get_gears(), get_locations(), get_ports(), get_species(), get_species_itis()

Examples

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

# extracts vessel ID, crew size, and home port on custom sql statement
sqlStatement <- "select vessel, crew, homeport from cfdbs.mstrvess;"
get_vessels(channel,sqlStatement)

# extracts all vessel info for vessels lengths < 50ft based on custom sql statement
sqlStatement <- "select * from cfdbs.mstrvess where vesslen <29;"
get_vessels(channel,sqlStatement)

## End(Not run)


NOAA-EDAB/comlandr documentation built on March 1, 2025, 8 p.m.