gbar.error: barplot with errorbars

gbar.errorR Documentation

barplot with errorbars

Description

Barplot with confidence intervals. To plot with confidence intervals around an event that has a binary outcome with a simple example:

Usage

gbar.error(
  y,
  conf.low,
  conf.high,
  group,
  wes = "Royal1",
  other.palette = NULL,
  print = TRUE,
  fill = NULL,
  stat = "identity",
  facet1 = NULL,
  facet2 = NULL,
  bar.width = 0.9,
  position = position_dodge(width = 0.9),
  transpose = FALSE,
  facet.scales = "fixed"
)

Arguments

y

any numeric vector, can be a fraction

conf.low

the lower bound of the confidence interval around y

conf.high

the upper bound of the confidence interval around y

Details

heads = 30, tails = 20, y = heads / (heads + tails) dt = binom.conf(y, heads + tails) conf.low = dt$conf.low conf.high = dt$conf.high

gbar.error(y, conf.low, conf.high)

Value

A ggplot object


kevinmhadi/khtools documentation built on Jan. 16, 2025, 4:18 p.m.