get_strata: Extract STRATA information from SVDBS

View source: R/get_strata.R

get_strataR Documentation

Extract STRATA information from SVDBS

Description

Extract STRATA information from the SVDBS SVMSTRATA table

Usage

get_strata(channel, strata = "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)

strata

Numeric or character vector. Set of strata codes. Defaults to "all" strata. Numeric codes are converted to VARCHAR2(5 BYTE) when creating the sql statement. Alternatively enter name of stratum

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

See Also

connect_to_database

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

Examples

## Not run: 
# extracts complete strata table
channel <- dbutils::connect_to_database(server="serverName",uid="userName")
get_strata(channel)

# extracts info for a single stratum
get_strata(channel,strata=6940)
get_strata(channel,strata="6940")
get_strata(channel,"SNE BLOCK ISLAND")
get_strata(channel,"SNE Block Island")

# extracts multiple strata
get_strata(channel,strata= c(6940,6400,6380))
get_strata(channel,strata=c("6940","6400","6380"))

## End(Not run)


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