geom_errorbarh {ggplot2}R Documentation

geom\_errorbarh

Description

Horizontal error bars

Usage

geom_errorbarh(mapping = NULL, data = NULL, stat = "identity", 
    position = "identity", ...)

Arguments

mapping

mapping between variables and aesthetics generated by aes

data

dataset used in this layer, if not specified uses plot dataset

stat

statistic used by this layer

position

position adjustment used by this layer

...

ignored

Details

This page describes geom\_errorbarh, see layer and qplot for how to create a complete plot from individual components.

Value

A layer

Aesthetics

The following aesthetics can be used with geom\_errorbarh. Aesthetics are mapped to variables in the data with the aes function: geom\_errorbarh(aes(x = var))

Author(s)

Hadley Wickham, http://had.co.nz/

See Also

Examples

## Not run: 
df <- data.frame(
  trt = factor(c(1, 1, 2, 2)), 
  resp = c(1, 5, 3, 4), 
  group = factor(c(1, 2, 1, 2)), 
  se = c(0.1, 0.3, 0.3, 0.2)
)

# Define the top and bottom of the errorbars

p <- ggplot(df, aes(resp, trt, colour = group))
p + geom_point() +
  geom_errorbarh(aes(xmax = resp + se, xmin = resp - se))
  

## End(Not run)

[Package ggplot2 version 0.8.9 Index]