Skip to contents

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 <- load_pop_data(
  file_path = "https://osf.io/download//n6cp3/",
  age = "Age",
  id = "index_id",
  value = "result",
  standardize = TRUE
)

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

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