| gadget_update.gadgetstock | R Documentation |
Replace components of a gadgetstock with either new values or or content derived from an MFDB query.
## S3 method for class 'gadgetstock' gadget_update(gf, component, ...)
gf |
The gadgetfile object to update |
component |
The component to update, or 'stock' to update the initial values |
... |
Either 0, data = (mfdb_query), or keys to update. See details. If
Finally, any other value of naturalmortality is slightly different. It takes a single vector with one value per-age-group. It will be pre-populated with 0.2 for each age group. doesgrow / growth can be populated with default values with
doesmature / maturation will populate the maturityfile data file with all given parameters apart
from doesrenew / recruitment can be populated from MFDB queries, e.g.
|
## Not run:
library(magrittr) # import %>% function
path <- './model'
gadgetstock('codimm', path, missingOkay = TRUE) %>% # Create a skeleton if missing
gadget_update('stock', minage = 2, maxage = 4) %>%
gadget_update('stock', stockname = 'codmat') %>% # Will change the name of the file we write
gadget_update('doesmigrate', yearstepfile = gadgetfile('data/yearstepfile', components = list(
data.frame(year = 1998, step = 1:4,
matrix = 'codmat-migration')))) %>%
gadget_update('doesrenew', 0) %>%
write.gadget.file(path)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.