run_model function

A function that runs an app for specific settings and processes results for plot and text generation

A function that runs an app for specific settings and processes results for plot and text generation

This function runs a model based on information provided in the modelsettings list passed into it.

run_model(modelsettings)

Arguments

  • modelsettings: a list with model settings. Required list elements are:

    modelsettings$simfunction - name of simulation function(s) as string.

    modelsettingsismbmodelindicateofsimulationfunctionhasmbmodelstructuremodelsettingsis_mbmodel - indicate of simulation function has mbmodel structure modelsettingsmodeltype - specify what kind of model should be run. Currently one of: ode, discrete, stochastic, usanalysis, modelexploration, fit.

    For more than one model type, place and between them.

    modelsettings$plottype - 'Boxplot' or 'Scatterplot' , required for US app

    Optinal list elements are:

    List elements with names and values for inputs expected by simulation function. If not provided, defaults of simulator function are used.

    modelsettings$plotscale - indicate which axis should be on a log scale (x, y or both). If not provided or set to '', no log scales are used.

    modelsettings$nplots - indicate number of plots that should be produced (number of top list elements in result). If not provided, a single plot is assumed.

    modelsettings$nreps - required for stochastic models to indicate numer of repeat simulations. If not provided, a single run will be done.

Returns

A vectored list named "result" with each main list element containing the simulation results in a dataframe called dat and associated metadata required for generate_plot and generate_text functions. Most often there is only one main list entry (result[[1]]) for a single plot/text.

Details

This function runs a model for specific settings.