standardize_rdat: Change non-standard names of rdat objects to standard naming...

View source: R/standardize_rdat.r

standardize_rdatR Documentation

Change non-standard names of rdat objects to standard naming conventions. Compute standard objects.

Description

Change non-standard names of rdat objects to standard naming conventions. Compute standard objects.

Usage

standardize_rdat(
  rdat,
  separator_key = c(. = "_"),
  separator_key_x = names(rdat),
  fleet_replace = TRUE,
  fleet_key = list(sCT = c("CVT"), sTV = c("CVID", "Mcvt"), sVD = c("VID"), sBT =
    c("Mbft"), sBL = c("sM"), sVL = c("vll"), sFT = c("FST"), sAN = c("nad"), sAM =
    c("mad"), sAS = c("sad"), sJA = c("jai"), sME = c("mareco"), cDV = c("cD"), cHL =
    c("cH", "cHl"), cLL = c("cL"), cOT = c("cO"), cPT = c("cp", "cP"), cTW = c("cT",
    "cTw", "cHTR"), cGN = c("comm"), cRN = c("cRn"), cRS = c("cRs"), cBN = c("cBn"), cBS
    = c("cBs"), rHB = c("HB", "hb", "rHb"), rHD = c("hbd", "HBD"), rGN = c("GR", "mrip",
    "rGe", "rA")),
  fleet_key_x = c("parms", "parm.cons", "t.series", "comp.mats", "sel.age", "sel.parms"),
  parms_key = c(R0 = "BH.R0", M.msst = "M.constant", M.MSST = "M.constant"),
  a_series_key = c(mat.male.endyr = "mat.male", mat.fem.endyr = "mat.female",
    prop.female.endyr = "prop.female"),
  t_series_key = c(total.L.wgt.klb = "total.L.klb"),
  na_values = "-99999"
)

Arguments

rdat

rdat (list) object read in with dget(). Specifically, the BAM output file produced by the cxx file.

separator_key

named vector indicating what separator(s) should be used in the rdat. By default, any "_" will be replaced with "." in names of rdat elements

separator_key_x

names of elements in the rdat list to apply the fleet_key to.

fleet_replace

Should fleet_key be applied to fleet_key_x to replace fleet_abbreviations in the rdat?

fleet_key

list where values are patterns (character vector) to find in rdat list elements specified with fleet_key_x and the names are the replacements. Patterns are searched with regex to find these values at the beginning or end of character strings, followed or preceded by ".", or in the middle of a string preceded and followed by ".".

fleet_key_x

names of elements in the rdat list to apply the fleet_key to.

parms_key

named vector where values are patterns (character strings) to find in names(rdat$parms) and the names in parms_key are replacements

a_series_key

named vector where values are patterns (character strings) to find in names(a.series$parms) and the names in a_series_key are replacements

t_series_key

named vector where values are patterns (character strings) to find in names(t.series$parms) and the names in t_series_key are replacements

na_values

Other values to change to NA

Author(s)

Nikolai Klibansky

Examples

## Not run: 
names(rdat_RedPorgy$a.series)
rdat_RedPorgy_std <- standardize_rdat(rdat_RedPorgy)
names(rdat_RedPorgy_std$a.series)

## End(Not run)

nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.