Barplot: Titer bar plots.

View source: R/Barplot.R

BarplotR Documentation

Titer bar plots.

Description

Barplot plots the baseline and day 28 titers

Usage

Barplot(
  dat_list,
  subjectCol = "SubjectID",
  cols = 1,
  groupVar = NULL,
  colors = c("#A6CEE3", "#1F78B4", "#B2DF8A", "#33A02C", "#FB9A99", "#E31A1C",
    "#FDBF6F", "#FF7F00")
)

Arguments

dat_list

a named list like the one returned by FormatTiters.

subjectCol

the name of the column specifying a subject ID. Default is "SubjectID".

cols

numeric specifying how many columns to layout plot

groupVar

an optional character string specifying a grouping variable. May be either a variable in dat_list or an endpoint. Default is NULL

colors

a vector of colors specifying bar colors. If dat_list contains more than 4 elements, you must specify your own colors.

Value

(invisibly) a list of ggplot2 object(s).

Author(s)

Stefan Avey

Examples

## Prepare the data
titer_list <- FormatTiters(Year1_Titers)

## Bar plot of a single strain
Barplot(titer_list["A California 7 2009"])

## Bar plot of all 3 strains
Barplot(titer_list)

## Can improve readability of previous plot by separating into groups
## For example, group by AgeGroup
Barplot(titer_list, groupVar = "AgeGroup")

stefanavey/titer documentation built on Jan. 27, 2023, 3:41 a.m.