Skip to contents

Extract a list of dealer names and locations from supporting tables

Usage

get_dealers(channel, state = NA, year = NA)

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)

state

Character vector. State abbreviations. Default = NA (All states)

year

Numeric vector. Years in which to pull data. Defaul = NA (All years)

Value

A list is returned:

data

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

Reference

Use the data dictionary for field name explanations

Examples

if (FALSE) { # \dontrun{
# extracts dealer location table
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_dealers(channel)

# extracts dealer details for states, Massachusetts and Maine
get_dealers(channel,state = c("MA","ME"))

# extracts dealer details for years 2010 to 2020
get_dealers(channel, year = 2010:2020)

# extracts dealer details for years 2010 to 2020 for MA & ME
get_dealers(channel, state = c("MA","ME"), year = 2010:2020)
} # }