autoplot.pop_data {serocalculator}R Documentation

Plot distribution of antibodies

Description

autoplot() method for pop_data objects

Usage

## S3 method for class 'pop_data'
autoplot(object, log = FALSE, type = "density", strata = NULL, ...)

Arguments

object

A pop_data object (from load_pop_data())

log

whether to show antibody responses on logarithmic scale

type

an option to choose type of chart: the current options are "density" or "age-scatter"

strata

the name of a variable in pop_data to stratify by (or NULL for no stratification)

...

unused

Value

a ggplot2::ggplot object

Examples


library(dplyr)
library(ggplot2)

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

xs_data %>% autoplot(strata = "Country", type = "density")
xs_data %>% autoplot(strata = "Country", type = "age-scatter")


[Package serocalculator version 1.0.3 Index]