GetSurveyAbb.fn: Get Survey Abbreviation

View source: R/GetSurveyAbb.fn.R

GetSurveyAbb.fnR Documentation

Get Survey Abbreviation

Description

Get Survey Abbreviation

Usage

GetSurveyAbb.fn(surveys = "Combo", na.return = "")

Arguments

surveys

A vector of strings specifying the survey names that you want to get abbreviations for.

na.return

The desired entry you want to replace all is.na() values with. The default is to return values of "" instead of NA, though you can change it to actually return NA values by using na.return = NA as is, i.e., without quoting NA.

Details

Get abbreviations for a vector of survey names. The input vector of names, which are typically names used to pull the data from the warehouse, do not always match the name agreed upon within the Population Ecology Program. So, standard abbreviations are returned for a given warehouse name. Partial matches are allowed, and are searched for using the first two columns of createMatrix(), so be weary of using terms used for multiple surveys as only the first match will be returned for each input value.

Value

A vector of strings containing a single abbreviation for each input value in surveys. Only the first match for each survey is returned. The function returns "" for surveys not found in the matrix by default, but this return value for unmatched surveys can be changed by altering na.return.

Author(s)

Kelli Faye Johnson

See Also

See createMatrix() for a list of available surveys.

Examples

# Return a vector of agreed upon abbreviations for the
# Triennial Survey and the West Coast Groundfish Bottom Trawl Survey.
GetSurveyAbb.fn(c("Triennial", "Combo"))



nwfsc-assess/nwfscSurvey documentation built on Nov. 12, 2024, 8:14 p.m.