get_species: Extract SPECIES information from SVDBS

View source: R/get_species.R

get_speciesR Documentation

Extract SPECIES information from SVDBS

Description

Extract a list of speices names, code, market category, etc from the SVDBS SVSPECIES_LIST table

Usage

get_species(channel, species = "all")

Arguments

channel

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

species

Numeric or character vector. a specific species code or set of codes. Defaults to "all" species. Numeric codes are converted to VARCHAR2(3 BYTE) when creating the sql statement. Character codes are short character strings.

Value

A list is returned:

species

containing the result of the executed $sql statement

sql

containing the sql call

colNames

a vector of the table's column names

The default sql statement "select * from svdbs.svspecies_list" is used

Reference

Use the data dictionary for field name explanations

Note: species codes (svspp) are stored in the database as VARCHAR2(3 BYTE)

See Also

connect_to_database

Other helper: get_conversion_factors(), get_cruise_purpose(), get_maturity(), get_sex_fscs(), get_sex(), get_strata(), get_vessel()

Examples

## Not run: 
# extracts complete species table based on custom sql statement
channel <- dbutils::connect_to_database(server="serverName",uid="userName")
get_species(channel)

# extracts info for cod (73)
get_species(channel,species=73)
get_species(channel,"cod")
get_species(channel,"co")
get_species(channel,"COD")

# extracts info for cod (73)  and bluefish (135)
get_species(channel,species= c("73","135"))

## End(Not run)


andybeet/survdat documentation built on Nov. 9, 2023, 10:11 a.m.