create_argfiles: Create template argument input files

Description Usage Arguments Details Author(s) Examples

View source: R/create_argfiles.r

Description

Creates template input files based on the argument lists for specified functions. Look in your working directory for the template files. Change the case ID number (defaults to 0) and the species identifier to a three letter identifier. To use one of the built-in model setups, use one of cod, sar, or fla for cod, sardine, or flatfish. An example filename would be M1-sar.txt or lcomp2-fla.txt.

Usage

1
2
3
4
5
create_argfiles(functions = c(`lcomp0-spp` = "sample_lcomp",
  `agecomp0-spp` = "sample_agecomp", `index0-spp` = "sample_index",
  `F0-spp` = "change_f", `R0-spp` = "change_retro", `E0-spp` = "change_e",
  `X0-spp` = "change_tv"), ext = ".txt", delim = "; ",
  ignore = c("file", "dir", "make_plot"), ...)

Arguments

functions

A named vector. The names correspond to the filenames that will get written. The values correspond to the functions to grab the arguments from.

ext

The file extension to create the configuration files with. Defaults to ".txt".

delim

The delimiter. Defaults to "; ".

ignore

A vector of character object of arguments to ignore in the arguments. Found via grep so can be part of an argument name.

...

Anything else to pass to write.table.

Details

The first column in the text files denotes the argument to be passed to a function. The second argument denotes the value to be passed. You can use any simple R syntax. For example: c(1, 2, 4), or seq(1, 100) or 1:100 or matrix(). Character objects don't need to be quoted. However, be careful not to use your delimiter (set up as a semicolon) anywhere else in the file besides to denote columns.

The function change_tv is a special case. To pass arguments to change_tv through a run_ss3sim: (1) create a case file with an arbitrary letter not used elsewhere (anything but D, E, F, or R) and include the line function_type; change_tv in your case file. For example, you might want to use M for natural mortality, S for selectivity, or G for growth.

This function (create_argfiles) automatically adds a line function_type; change_tv to the top of a case file X0-spp.txt as a starting point for change_tv.

Author(s)

Sean Anderson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
create_argfiles()
# Some example input lines:
#
# year1; 1990
# years; 1990:2000
# years; c(1980, 1990, 1995)
# survey_type; fishery

## End(Not run)

ss3sim documentation built on Nov. 9, 2019, 1:06 a.m.