Description Usage Arguments Details Value Examples
View source: R/print_many_plots.R
Plotting data from EpiModel simulation
1 2 3 4 5 6 7 8 9 | print_many_plots(
plotting_params,
sim_obj,
num_hash = 3,
targ_df = EpiModelWHAMPDX::WHAMP.targs,
othr_args = NULL,
sub_atrs = NULL,
print_sec = TRUE
)
|
plotting_params |
A list containing information a description of what is to be plotted and what sections of these plots should be named. The list will be a list of lists, in which each sub list contains information for a desired set of plots. See details for more information. |
sim_obj |
The dat object from an EpiModel Simulation |
num_hash |
The number of hashes for the top level section name |
targ_df |
The dataframe with the desired targets. The value of the 'measure' column for the desired column should match that of the plot_name inside of the plotting_params sublists. See details for more information. |
sub_atrs |
Which attributes to break out the measure by. If no value is given, all present attribute breakdowns will be shown. |
print_sec |
Logical for if the section title should be printed. |
other_args |
Experimental. Pass ggplot commands to be added to the base plot as a string, to be used with a parse eval command. |
The 'plotting_params' object contains 'plot_name' argument which is the formal name of the measure you wish to plot. The other 'name' which is the name of the variable that will be as it appears in the epi list object (dat$epi).
If the epi measure you wish to plot must be constructed, two additional arguments must be given, and the 'name' argument can be chosen by the user. While 'name' can be set to any string, the user should make sure this name matches any target they wish to match.
The first additional argument that must be specified is the 'vars'. This argument gives the names of the epi measures currently stored inside of epi that will be used to construct the epi measure of interest. As an example, if the measure of interest was prevalence, the 'vars' argument would be 'c("num.", "num.i.")' because the number and number of individuals infected could be used to construct prevalence.
The second additional argument that must be specified is the 'FUN' argument. This argument gives the function that will calculate the epi measure of interest from the 'vars' arguments given. Note that this function should take a number of arguments that matches the length of 'vars'. The function should also take arguments in the order that they appear in 'vars'. Continuing our example of prevalence, the function we would specify would be 'function(x, y) = y / x'.
Print the results of one or more sets of EpiModel diagnostic plots.
1 | # see vignette
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.