write_inputs_ling: write SS input files for a lingcod model

View source: R/write_inputs_ling.R

write_inputs_lingR Documentation

write SS input files for a lingcod model

Description

writes SS input files using the list created by get_inputs_ling() (presumably after modification of one or more elements) using the ⁠r4ss::SS_write*()⁠ functions for the four model input files.

Usage

write_inputs_ling(
  inputs,
  dir = NULL,
  files = c("dat", "ctl", "start", "fore"),
  datname = "ling_data.ss",
  ctlname = "ling_control.ss",
  startname = "starter.ss",
  forename = "forecast.ss",
  overwrite = TRUE,
  verbose = FALSE
)

Arguments

inputs

list created by get_inputs_ling()

dir

model directory (like "models/2021.s.001.001_new_fleets"). The inputs list includes a dir element, but this will match the source directory prior to any changes to the model files so requiring a new dir input will help users (or at least Ian) ovoid accidentally overwriting the source files.

files

vector of file types to write (default is four standard input files–.par file not yet supported)

datname

name of data file to write

ctlname

name of control file to write

startname

name of starter file to write

forename

name of forecast file to write

Author(s)

Ian G. Taylor

See Also

get_inputs_ling(),

Examples

## Not run: 
  # read inputs
  inputs <- get_inputs_ling(area ="s", num = 99)
  # add new data
  inputs_with_x_changes <- inputs
  inputs_with_x_changes$dat <- add_data(inputs$dat, area = "s")
  # write the files back to the source directory
  write_inputs_ling(inputs = inputs_with_x_changes,
                    dir = "models/2021.s.099.001_with_x_changes",
                    files = "start")

  # read inputs
  inputs <- get_inputs_ling(area ="s", num = 99)
  # make small change (e.g. use the .par file)
  inputs$start$init_values_src <- 1
  # write the files back to the source directory
  write_inputs_ling(inputs = inputs,
                    dir = inputs$dir,
                    files = "start")

## End(Not run)

iantaylor-NOAA/Lingcod_2021 documentation built on Oct. 30, 2024, 6:42 p.m.