Plot method for summary.seroincidence.by
objects
Source: R/autoplot.summary.seroincidence.by.R
autoplot.summary.seroincidence.by.Rd
Plot method for summary.seroincidence.by
objects
Usage
# S3 method for class 'summary.seroincidence.by'
autoplot(object, xvar, alpha = 0.7, shape = 1, width = 0.001, ...)
Arguments
- object
a
summary.seroincidence.by
object (generated by applying thesummary()
method to the output ofest.incidence.by()
).- xvar
the name of a stratifying variable in
object
- alpha
transparency for the points in the graph (1 = no transparency, 0 = fully transparent)
- shape
shape argument for
geom_point()
- width
width for jitter
- ...
unused
Value
a ggplot2::ggplot()
object
Examples
library(dplyr)
library(ggplot2)
xs_data <- load_pop_data("https://osf.io/download//n6cp3/")
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
)
#> Warning: curve_params is missing all strata variables, and will be used unstratified.
#>
#> To avoid this warning, specify the desired set of stratifying variables in the `curve_strata_varnames` and `noise_strata_varnames` arguments to `est.incidence.by()`.
#> Warning: noise_params is missing all strata variables, and will be used unstratified.
#>
#> To avoid this warning, specify the desired set of stratifying variables in the `curve_strata_varnames` and `noise_strata_varnames` arguments to `est.incidence.by()`.
est2sum <- summary(est2)
autoplot(est2sum, "catchment")