This function solves an ODE model using 'deSolve' and returns the output as a data frame.
run_shiny(model = "SIR", neweqns = NULL, ics = NULL, tstart = 0,
timestep = 1, tmax = 365, parm0 = NULL, parm_names = NULL,
parm_min = NULL, parm_max = NULL, sigfigs = 4, showtable = TRUE,
linesize = 1.2, textsize = 14, xlabel = "Time",
ylabel = "Number of individuals", legend_title = "Compartment",
slider_steps = NULL, values = NULL, ...)
name of the model to be solved. Examples of built-in models are: "SIR", "SIR vaccination". Default is "SIR".
function specifying the equations of the user-defined model. Only to be used if a model is required that is not built-in. Default is NULL.
named numeric vector specifying the initial conditions i.e. the initial values of all model variables. Default is c(S = 9999, I = 1, R = 0) for the SIR model.
numerical value of form c(tmin, tmax) indicating the time to start simulations. Default value is 0.
numerical value indicating time step be used when solving equations. Default value is 1/365.
numerical value indicating maximum time point to be considered.
named numeric vector of starting parameter values. Names must correspond to those used in the model equations.
character vector of parameter names to be displayed in shiny menu. Must be in the same order as 'parm0'.
named numeric vector of minimum parameter values.
named numeric vector of maximum parameter values.
number of significant figures to round parameter input vectors. Default is 4.
logical TRUE/FALSE. Should the table of transformed parameters be shown? Only applies to built-in models. Default is TRUE.
numeric value for line width in ggplot output. Default is 1.2.
numeric value for textsize in ggplot output. Default is 14.
character string for x axis plotting label. Default is "Time".
character string for y axis plotting label. Default is "Number of individuals".
character string for legend title. Default is "Compartment".
numeric vector of step size to include between slider input values. Should be NULL or a vector with an entry for each parameter input. Default is NULL.
vector specifying manual color scale (if desired). Length must equal the number of model variables.
extra argument to be passed through to ggplot scale_colour_manual: use 'labels' to change the legend names.
data frame of model solutions in long format.
# NOT RUN {
run_shiny(model = "SIR")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab