Extract a list of length and weights for species sampled in nefsc surveys (spring and fall) This data is extracted from svdbs.union_fscs_svbio

get_length_weight_data(channel, year = 1994, species = "all", sex = "all")

Arguments

channel

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

year

Numeric or character vector. The Year(s) to pull data for. (Uses the cruise6 field to search for year). Default = 1994. For all years use year = "all"

species

Numeric vector. Survey code for species (SVSPP codes). Defaults to "all" species. Numeric codes are converted to VARCHAR2(3 BYTE) when creating the sql statement.

sex

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

Value

A list of 3 items data, sql, colNames

The data frame (data) (Descriptions taken from NEFSC Data dictionary)

CRUISE6

Code uniquely identifying cruise. The first four digits indicate the year and the last two digit uniquely identify the cruise within the year. The 5th byte signifies cruises other than groundfish: Shrimp survey = 7 (i.e. 201470), State of Massachusetts survey = 9 (i.e. 201491), Food habits = 5 (i.e.199554)

STRATUM

A predefined area where a net dredge, or other piece of gear was deployed. Code consists of 2 parts: Stratum group code number (2 bytes) and stratum number (3 bytes). Stratum group refers to if area fished is inshore or offshore North or South of Cape Hatteras or the type of cruise (shellfish, State of MA, offshore deepwater). The stratum number (third and fourth digits of code) refers to area defined by depth zone. See SVDBS.SVMSTRATA. The fifth digit of the code increases the length of the stratum number for revised strata after the Hague Line was established. Stratum group code: 01 = Trawl, offshore north of Hatteras; 02 = BIOM; 03 = Trawl, inshore north of Hatteras; 04 = Shrimp; 05 = Scotian shelf; 06 = Shellfish; 07 = Trawl, inshore south of Hatteras; 08 = Trawl, Offshore south of Hatteras; 09 = MA DMF; 99 = Offshore deepwater (outside the stratified area). A change in Bottom Trawl Stratum for the Gulf of Maine-Bay of Fundy has been in effect since Spring 1987, and may be summarized as follows: Previous strata: 01350; Present strata: 01351, 01352.

TOW

Sequential number representing order in which station was selected within a stratum.

STATION

Unique sequential order in which stations have been completed. Hangups and short tows each receive a non-repeated consecutive number.

SVSPP

A standard code which represents a species caught in a trawl or dredge. Refer to the SVDBS.SVSPECIES_LIST

SEASON

Season of the year in which cruise was conducted.

SEX

Code indicating sex of fish or invertebrate species. See SVDBS.FSCS_SEX_CODES if using fscs data and SVDBS.SEX_CODES if using non FSCS data. Codes 0, 1, 2 and 4 are the only valid codes in fscs tables.

INDID

A unique identifier for each fish sampled.

LENGTH

Measured length of species in centimeters (cm). Measure method differs by species.

INDWT

Individual weight (KG) of species being sampled.

STOM_WGT

Stomach weight of an individual fish in grams.

STOM_VOLUME

Volume of the stomach contents of the fish sampled, measured to the nearest tenth of a cubic centimeter (cc).

MATURITY

Stage of maturation of the fish being sampled. See SVDBS.FSCS_MATURITY_CODES

The sql statement

sql

containing the sql call

The data frame listing all columns in the table

colNames

a vector of the table's column names

Reference

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

See also

connect_to_database

Examples

if (FALSE) { # \dontrun{
# extracts length-weight data for cod (73) for all years and sexes
channel <- connect_to_database(server="servername",uid="username")
codPull <- get_length_weight_data(channel,year = "all", species=73)
} # }