plot.FOIfit | R Documentation |
Plot the mean and credible interval of the yearly force of infection, given an object of the class FOIfit
. The function plot
uses the package ggplot2
. It returns a graphical object that can be further modified.
## S3 method for class 'FOIfit'
plot(
FOIfit,
mean_only = FALSE,
individual_samples = 0,
YLIM = 1,
XLIM1 = NULL,
XLIM2 = NULL,
...
)
FOIfit |
The |
mean_only |
Boolean. If |
individual_samples |
Integer. Number of individual samples to be plotted additionally to the mean and the credible interval of the force of infection. The |
YLIM |
Upper limit of the y-axis. Default = 1. The lower limit is set to 0. |
A list of ggplot2
objects.
Nathanael Hoze nathanael.hoze@gmail.com
data <- simulate_SeroData( max_age = 50, epidemic_years = c(1976,1992), foi = c(0.2,0.3))
model <- FOImodel(type='outbreak', K = 2)
Fit <- fit(model = model, data = data)
p <- plot(Fit)
p+ylim(0,1)
p[[1]]$category # the name of the category plotted
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.