Description Usage Arguments Details Value Which arguments to specifiy in case files Author(s) See Also Examples
View source: R/sample_mlacomp.R
[BETA VERSION] Sample mean length (size-)-at-age data and write to file for use by the EM.
1 2 | sample_mlacomp(dat_list, outfile, ctl_file_in, fleets = 1, Nsamp, years,
mean_outfile = NULL, verbose = TRUE)
|
dat_list |
An SS data list object as read in from
|
outfile |
A character string specifying the file name to use
when writing the information to the disk. The string must include
the proper file extension. No file is written using the default value
of |
ctl_file_in |
A path to the control file, output from an OM, containing the OM parameters for growth. These values are used to determine the uncertainty about size for fish sampled in each age bin. |
fleets |
*A vector of integers specifying which fleets to include.
The order of the fleets pertains to the input order of other arguments.
An entry of |
Nsamp |
*A numeric list of the same length as |
years |
*A list the same length as |
mean_outfile |
A path to write length and age data for external
estimation of parametric growth. If |
verbose |
Logical value whether or not diagnostic information from r4ss functions should be printed to the screen. Default is FALSE. |
**This function is in beta and untested. Use with caution.**
Take a data.SS_new
file, read in by r4ss function
SS_readdat
containing observed values, and
sample from the observed ages to get realistic proportions for the number
of fish in each age bin, then use the mean size-at-age and CV for growth to
generate random samples of size, which are then averaged to get mean
length-at-age values. These values are then written to file for the
EM.
A modified .dat
file if !is.null(outfile)
. A list object
containing the modified .dat
file is returned invisibly.
All function argument descriptions that start with an asterisk (*) will be passed
through the case files to run_ss3sim
. If one of these arguments
is not specified in a case file, then a value of NULL
will be passed,
which may or may not be an appropriate value. Other arguments will be ignored
if specified.
Cole Monnahan, Kelli Johnson
Other sampling functions: clean_data
,
sample_agecomp
,
sample_calcomp
, sample_index
,
sample_lcomp
, sample_wtatage
1 2 3 4 5 6 7 8 9 10 11 12 | d <- system.file(file.path("extdata", "models", "cod-om"),
package = "ss3sim")
dat_in <- file.path(d, "codOM.dat")
dat_list <- r4ss::SS_readdat(dat_in, version = NULL, verbose = FALSE)
dat_list <- change_data(dat_list, outfile = NULL,
fleets = 1, years = seq(dat_list$styr, dat_list$styr + 5),
types = c("age", "mla"))
ctl_file_in <- file.path(d, "codOM.ctl")
out <- sample_mlacomp(dat_list, outfile = NULL, ctl_file_in = ctl_file_in,
fleets = 1, Nsamp = 30, years = list(dat_list$styr + 5),
verbose = FALSE, mean_outfile = NULL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.