Learn R Programming

ss3sim (version 0.9.5)

change_fltname: Standardize column name for FltSvy in event r4ss is not the newest version.

Description

change_fltname alters the name for the fleet/survey column which is typically named FltSvy by SS_readdat, but was inconsistent in older versions (.e.g. Fleet was used for mean size-at-age).

Usage

change_fltname(dat_list)

Arguments

dat_list

An SS data list object as read in from SS_readdat in the r4ss package. Make sure you select option section=2.

Value

An invisible data list.

Examples

Run this code
# NOT RUN {
d <- system.file("extdata", package = "ss3sim")
file_in <- file.path(d, "Simple", "simple.dat")
# Here one should include the argument \code{section = 2}
# but this \code{.dat} file does not have multiple sections.
dat_in <- r4ss::SS_readdat(file_in, verbose = FALSE)
dat_fixed <- change_fltname(dat_in)
# Check mean size-at-age
names(dat_fixed$MeanSize_at_Age_obs)[3] == "FltSvy"
# }

Run the code above in your browser using DataLab