autoplot.seroincidence.by {serocalculator}R Documentation

Plot seroincidence.by log-likelihoods

Description

Plots log-likelihood curves by stratum, for seroincidence.by objects

Usage

## S3 method for class 'seroincidence.by'
autoplot(object, ncol = min(3, length(object)), ...)

Arguments

object

a '"seroincidence.by"' object (from est.incidence.by())

ncol

number of columns to use for panel of plots

...

Arguments passed on to autoplot.seroincidence

log_x

should the x-axis be on a logarithmic scale (TRUE) or linear scale (FALSE, default)?

Value

an object of class "ggarrange", which is a ggplot2::ggplot() or a list() of ggplot2::ggplot()s.

Examples


library(dplyr)
library(ggplot2)

xs_data <- "https://osf.io/download//n6cp3/" %>%
  load_pop_data() %>%
  clean_pop_data

curve <- load_curve_params("https://osf.io/download/rtw5k/") %>%
  filter(antigen_iso %in% c("HlyE_IgA", "HlyE_IgG")) %>%
  slice(1:100, .by = antigen_iso) # Reduce dataset for the purposes of this example

noise <- load_noise_params("https://osf.io/download//hqy4v/")


est2 <- est.incidence.by(
  strata = c("catchment"),
  pop_data = xs_data %>% filter(Country == "Pakistan"),
  curve_params = curve,
  noise_params = noise %>% filter(Country == "Pakistan"),
  antigen_isos = c("HlyE_IgG", "HlyE_IgA"),
  #num_cores = 8, #Allow for parallel processing to decrease run time
  build_graph = TRUE
)

# Plot the log-likelihood curve
autoplot(est2)


[Package serocalculator version 1.0.3 Index]