plot: Plot the force of infection

plot.FOIfitR Documentation

Plot the force of infection

Description

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.

Usage

## S3 method for class 'FOIfit'
plot(
  FOIfit,
  mean_only = FALSE,
  individual_samples = 0,
  YLIM = 1,
  XLIM1 = NULL,
  XLIM2 = NULL,
  ...
)

Arguments

FOIfit

The FOIfit object to be plotted.

mean_only

Boolean. If FALSE, plot the mean force of infection as well as an envelope of the 95% credible interval. Default = FALSE.

individual_samples

Integer. Number of individual samples to be plotted additionally to the mean and the credible interval of the force of infection. The individual_samples samples are randomly chosen in the chains. Default = 0.

YLIM

Upper limit of the y-axis. Default = 1. The lower limit is set to 0.

Value

A list of ggplot2 objects.

Author(s)

Nathanael Hoze nathanael.hoze@gmail.com

Examples

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 



nathoze/Rsero documentation built on Oct. 22, 2024, 6:43 p.m.