R/plot_infection_histories.R
plot_cumulative_infection_histories.RdFor 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
)the infection history chain
only plot samples where samp_no > burnin
vector of individual ids to plot
if not NULL, adds lines to the plots showing the known true infection times
if not NULL, adds lines to show where the MCMC chain started
vector of times at which individuals could have been infected
how many samples from the MCMC chain to take?
if not NULL, adds lines to show when an individual was born
how many columns to use for the cumulative infection history plot
if TRUE, pads the infection history MCMC chain to have entries for non-infection events
if not NULL, pass a vector of indices to only take a subset of indices from possible_exposure_times
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_infection_history_posteriors(),
plot_model_fits(),
plot_total_number_infections()
if (FALSE) { # \dontrun{
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)
} # }