fig_errorbar: Error bar

Description Usage Arguments Examples

Description

Add error bars based y, ymin, ymax, and optionally group aspects.

Usage

1
2
fig_errorbar(g2, ..., line_size = 1, tip_size = 5, data = NULL,
  inherit_asp = TRUE, name = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

...

Any option, aesthetic (asp), or animation (Animation).

line_size, tip_size

Defines size of error bars.

data

A data.frame containing data to chart or a list.

inherit_asp

Whether to inherit aspects from g2r.

name

Name of figure, useful to apply functions to specific figures.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
df <- data.frame(
  trt = factor(c(1, 1, 2, 2)),
  resp = c(1, 5, 3, 4),
  group = factor(c(1, 2, 1, 2)),
  upper = c(1.1, 5.3, 3.3, 4.2),
  lower = c(0.8, 4.6, 2.4, 3.6)
)

g2(df, asp(trt, ymin = lower, ymax = upper, color = group)) %>% 
  fig_errorbar()

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.