plot_cumulative_infection_histories | R Documentation |
For each individual requested, plots the median and 95
plot_cumulative_infection_histories(
inf_chain,
burnin = 0,
indivs,
real_inf_hist = NULL,
start_inf = NULL,
possible_exposure_times,
nsamp = 100,
ages = NULL,
number_col = 1,
pad_chain = TRUE,
subset_times = NULL,
return_data = FALSE
)
inf_chain |
the infection history chain |
burnin |
only plot samples where samp_no > burnin |
indivs |
vector of individual ids to plot |
real_inf_hist |
if not NULL, adds lines to the plots showing the known true infection times |
start_inf |
if not NULL, adds lines to show where the MCMC chain started |
possible_exposure_times |
vector of times at which individuals could have been infected |
nsamp |
how many samples from the MCMC chain to take? |
ages |
if not NULL, adds lines to show when an individual was born |
number_col |
how many columns to use for the cumulative infection history plot |
pad_chain |
if TRUE, pads the infection history MCMC chain to have entries for non-infection events |
subset_times |
if not NULL, pass a vector of indices to only take a subset of indices from possible_exposure_times |
return_data |
if TRUE, returns the infection history posterior densities used to generate the plots |
two ggplot objects
Other infection_history_plots:
calculate_infection_history_statistics()
,
plot_antibody_data()
,
plot_antibody_predictions()
,
plot_estimated_antibody_model()
,
plot_individual_number_infections()
,
plot_infection_history_chains_indiv()
,
plot_infection_history_chains_time()
,
plot_model_fits()
,
plot_posteriors_infhist()
,
plot_total_number_infections()
## Not run:
data(example_inf_chain)
data(example_antigenic_map)
data(example_inf_hist)
data(example_antibody_data)
ages <- unique(example_antibody_data[,c("individual","birth")])
times <- example_antigenic_map$inf_times
indivs <- 1:10
plot_cumulative_infection_histories(example_inf_chain, 0, indivs, example_inf_hist, NULL, times,
ages=ages, number_col=2,pad_chain=FALSE, return_data=TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.