get_species | R Documentation |
Extract a list of speices names, code, market category, etc from the NEFSC cfspp table
get_species(channel, species = "all")
channel |
DBI Object. Inherited from DBIConnection-class. This object is used to connect
to communicate with the database engine. (see |
species |
a specific species code or set of codes. Either numeric or character vector. (NESPP3 codes) Numeric codes are converted to VARCHAR2(3 BYTE) when creating the sql statement. A Species common name can also be supplied. The character string is used to pull from SPPNM field. Defaults to "all" species. |
A list is returned:
species |
containing the result of the executed |
sql |
containing the sql call |
colNames |
a vector of the table's column names |
The default sql statement "select * from cfdbs.cfspp
" is used
Use the data dictionary (http://nova.nefsc.noaa.gov/datadict/) for field name explanations. Note: species codes (nespp3) are stored in the database as VARCHAR2(3 BYTE)
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_ports()
,
get_species_itis()
,
get_vessels()
## Not run:
# extracts complete species table based on custom sql statement
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_species(channel)
# extracts info for cod (081)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_species(channel,species=81)
# extracts info for cod ("COD")
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_species(channel,"cod") or
get_species(channel,"co") or
get_species(channel,"COD")
# extracts info for cod (081) and bluefish (023)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
sqlStatement <- "select * from cfdbs.cfspp"
get_species(channel,species= c("081","023"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.