get_lengths: Extract Length data from obdbs

Description Usage Arguments Value Reference See Also Examples

View source: R/get_lengths.R

Description

Extract a list of length for speices sampled by observers on commercial fishing boats This data is extracted from oblen

Usage

1
get_lengths(channel, species = "all", year = 1994, sex = "all")

Arguments

channel

an RODBC object (see connect_to_database)

species

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

year

a numeric vector containing the years to search over

sex

character vector. Default = "all". options "M" (male), "F" (female), "U" (unsexed)

Value

A list is returned:

data

containing the result of the executed $sql statement

sql

containing the sql call

colNames

a vector of the table's column names

Reference

Use the data dictionary (http://nova.nefsc.noaa.gov/datadict/) for field name explanations. Note: species codes (nespp4) are stored in the database as VARCHAR2(4 BYTE)

See Also

connect_to_database

Examples

1
2
3
4
5
6
7
8
## Not run: 
# extracts info for american flounder (plaice) (124)
channel <- connect_to_database(server="name_of_server",uid="individuals_username")
get_lengths(channel, species=124, year = "all")
get_lengths(channel, species="124", year = 2000, sex = "M")


## End(Not run)

andybeet/obdbs documentation built on Feb. 5, 2021, 9:24 p.m.