R/get_length_weight_data.R
get_length_weight_data.Rd
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")
an Object inherited from DBIConnection-class.
This object is used to communicate with the database engine. (see connect_to_database
)
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"
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.
Character vector. Default = "all". options "M" (male), "F" (female), "U" (unsexed)
A list of 3 items data
, sql
, colNames
The data frame (data
) (Descriptions taken from NEFSC Data dictionary)
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)
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.
Sequential number representing order in which station was selected within a stratum.
Unique sequential order in which stations have been completed. Hangups and short tows each receive a non-repeated consecutive number.
A standard code which represents a species caught in a trawl or dredge. Refer to the SVDBS.SVSPECIES_LIST
Season of the year in which cruise was conducted.
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.
A unique identifier for each fish sampled.
Measured length of species in centimeters (cm). Measure method differs by species.
Individual weight (KG) of species being sampled.
Stomach weight of an individual fish in grams.
Volume of the stomach contents of the fish sampled, measured to the nearest tenth of a cubic centimeter (cc).
Stage of maturation of the fish being sampled. See SVDBS.FSCS_MATURITY_CODES
The sql statement
containing the sql call
The data frame listing all columns in the table
a vector of the table's column names
Note: species codes (SVSPP) are stored in the database as VARCHAR2(3 BYTE)
connect_to_database
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)
} # }