generate: 'generate()' method for FLR4MFCL

generateR Documentation

'generate()' method for FLR4MFCL

Description

'generate()' can generate a range of different MFCL objects including 'par' and 'freq' files. The exact behaviour depends on the type of objects passed to 'generate()'. It is used to (hopefully) improve the workflow when manipulating MFCL objects in R, particularly when preparing objects for running projections, but also when generating new stock assessment input files from pseudo data.

Usage

generate(x, y, z, ...)

## S4 method for signature 'MFCLFrq,MFCLprojControl,ANY'
generate(x, y, z, ...)

## S4 method for signature 'MFCLPar,MFCLPar,MFCLFrq'
generate(x, y, z, ..., projection = TRUE)

## S4 method for signature 'MFCLPar,MFCLFrq,ANY'
generate(x, y, z, ...)

## S4 method for signature 'MFCLPar,MFCLPar,MFCLTagProj'
generate(x, y, z, ...)

## S4 method for signature 'MFCLTag,MFCLTag,missing'
generate(x, y, z, ...)

## S4 method for signature 'MFCLFrq,MFCLPseudo,MFCLTag'
generate(x, y, z, eff_crp_mult, ...)

## S4 method for signature 'MFCLIni,MFCLMSEControl,MFCLTag'
generate(x, y, z, z2 = "missing", ...)

Arguments

x

An MFCLFrq or MFCLPar object that will be expanded.

y

If x is an MFCLFrq then y is an MFCLprojControl. If x is MFCLPar, y is either an MFCLPar or MFCLFrq.

z

If x and y are MFCLPars then z is MFCLFrq. Alternatively if x and y are MFCLPar and MFCLFrq respectively then z is MFCLTagProj. Otherwise it is ignored.

...

Additional arguments (currently unused).

Details

There are currently five 'generate()' methods:

  • Generate an expanded MFCLFrq object from an existing MFCLFrq object and a MFCLprojControl object.

  • Generate an expanded MFCLPar object from an existing MFCLPar object and a MFCLFrq object. This is typically used for taking a expanding an existing par and using a 00 par (generated using the MFCL executable).

  • Generate an expanded MFCLPar object from an existing MFCLFrq object. This can be a useful way of avoiding making a 00 par with MFCL executable, reading it in, and blowing it up. It can be used for standard projection analyses that do not include additional tag data. Tests for this method can be found in the inst/mfcl_tests folder of the package source.

  • Generate an expanded MFCLPar object from an existing MFCLFrq object and a MFCLTagProj object. This method is method can be used to set up par objects that include additional tag data.

  • Generate new stock assessment input files MFCLFrq, MFCLTag, etc. objects from an MFCLPseudo object and a MFCLTagProj object.

Value

An object of the same type as the x argument, expanded and hopefully useable for running projections.

See Also

MFCLprojControl MFCLFrq MFCLPar

Examples

## Not run: 
# Expanding an MFCLFrq, e.g. that was used from in an assessment
frq <- read.MFCLFrq(initial_frq)
projCtrl <- MFCLprojControl(nyears=nyears, nsims=1, avyrs=avyrs, fprojyr=first_proj_yr, controls=proj_controls)
projfrq  <- generate(frq, projCtrl)
# Expanding an MFCLPar, e.g. that was generated as part of an assessment.
# After making a 00 par with the MFCL executable.
par <- read.MFCLPar(initial_par, first.yr=first_yr)
zero.par <- read.MFCLPar("00.par" first.yr=first_yr)
# Generate the new par file which has the right size for everything and has all the old information
projpar <- generate(par, zero.par, projfrq)
# Alternatively, expanding an MFCLPar without using the 00 par
projpar <- generate(par, projfrq)

## End(Not run)

PacificCommunity/ofp-sam-flr4mfcl documentation built on April 8, 2024, 6:47 p.m.