generate: 'generate()' method for FLR4MFCL

Description Usage Arguments Details Value See Also Examples

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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, ...)

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

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. Otherwise it is ignored.

...

Additional arguments (currently unused).

Details

There are currently three 'generate()' methods:

Value

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

See Also

MFCLprojContrl MFCLFrq MFCLPar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## 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 Nov. 16, 2020, 9:31 a.m.