Launch shiny gadget for matching mizer model to Ecopath data
Source:R/ecopath_tune.R
tuneEcopath.RdThe function opens a shiny gadget, an interactive web page. This page has a side panel with controls for various model parameters and a main panel with tabs for various diagnostic plots.
Usage
tuneEcopath(
params,
catch = NULL,
diet = NULL,
controls = c("ecopathGrowth", "ecopathDiffusion", "ecopathFishing",
"ecopathReproduction", "ecopathOther"),
tabs = c("ecopathSurvey", "ecopathSpectra", "ecopathCatch", "ecopathGrowth",
"ecopathRepro", "ecopathDiet", "ecopathDeath"),
match = c("growth", "yield", "catch", "consumption"),
preserve = c("erepro", "reproduction_level", "R_max"),
return_app = FALSE,
...
)Arguments
- params
MizerParams object to tune. If missing, the gadget tries to recover information from log files left over from aborted previous runs.
- catch
A data frame containing the observed binned catch data. It must contain the following columns:
species: The species for which the catch is recorded.gear: The gear used to collect the catch.length: The start of each bin.dl: The width of each bin.catch: The observed count for each bin.
- diet
An optional diet matrix to display in the Diet tab. If NULL, the diet tab will not show observed diet data.
- controls
A character vector of names of input parameter control sections that should be displayed in the sidebar. See
tuningGadget()for details.- tabs
A character vector of names of the tabs that should be displayed in the main section. See
tuningGadget()for details.- match
A character vector. Determines which quantities should be matched to observations each time the "match" button is pressed.
- preserve
Specifies whether the
reproduction_levelshould be preserved or the maximum reproduction rateR_maxor the reproductive efficiencyerepro(Default).- return_app
Boolean. For testing purposes only.
- ...
Other params needed by individual tabs.
Details
This gadget is meant for tuning a model to match Ecopath data and observed size distributions.
The model tuned here is non-interacting, so each species is always tuned
within a fixed background: changing a parameter recalculates only the selected
species' size spectrum and never affects the other species. Pressing the
"match" button runs optimisers that bring the model closer to the observed
data. See vignette("extending_the_tuning_gadget") for how the gadget works
and how to extend it.
There is an "Instructions" button near the top left of the gadget that gives you a quick overview of the user interface.
After you click the "Return" button in the side panel, the function will
return the parameter object in the state at that time, with Rmax set to
Inf and erepro set to the value it had after the last match to Ecopath.
See also
tuningGadget() for the underlying engine and how to add your own
controls and tabs; the article vignette("extending_the_tuning_gadget").