Description
plotDiet.MizerSim currently discards the simulation's time-varying abundance and delegates directly to plotDiet(object@params, ...):
plotDiet.MizerSim <- function(object, species = NULL, ...) {
plotDiet(object@params, species = species, ...)
}
This is inconsistent with every other .MizerSim plot method (plotFeedingLevel, plotPredMort, plotFMort, plotSpectra, plotCDF, …), which all accept a time_range argument and compute the plotted quantity from the simulation's actual abundance at the specified time.
The diet composition can change over the course of a simulation as species abundances shift, so ignoring the simulated n may produce misleading results when the system is not at the initial equilibrium.
Suggested fix
Add a time_range parameter to plotDiet.MizerSim. Extract the abundance at (or averaged over) the specified time step and pass it to plot_diet instead of params@initial_n. If no time is supplied, default to the final time step (matching the convention in plotFeedingLevel and plotPredMort).
Description
plotDiet.MizerSimcurrently discards the simulation's time-varying abundance and delegates directly toplotDiet(object@params, ...):This is inconsistent with every other
.MizerSimplot method (plotFeedingLevel,plotPredMort,plotFMort,plotSpectra,plotCDF, …), which all accept atime_rangeargument and compute the plotted quantity from the simulation's actual abundance at the specified time.The diet composition can change over the course of a simulation as species abundances shift, so ignoring the simulated
nmay produce misleading results when the system is not at the initial equilibrium.Suggested fix
Add a
time_rangeparameter toplotDiet.MizerSim. Extract the abundance at (or averaged over) the specified time step and pass it toplot_dietinstead ofparams@initial_n. If no time is supplied, default to the final time step (matching the convention inplotFeedingLevelandplotPredMort).