add_errorbars: Adds error bars to a plot

Description Usage Arguments Examples

Description

Yet another function that adds error bars. The user must specify the length of the error bars.

Usage

1
add_errorbars(x, y, SE, direction, barlen = 0.04, ...)

Arguments

x

The x coordinates of start of the error bar

y

The y coordinates of start of the error bar

SE

The length of the error bar

direction

One of 'up', 'down', 'right', 'left', 'updown' or 'rightleft'.

barlen

The length of the cross-bar at the end of the error bar.

...

Additional parameters passed to arrows, such as the colour (col). #' @details Simple wrapper for arrows, where angle=90 and code=3. The barlen argument corresponds to length in arrows.

Examples

1
2
3
4
5
6
# A simple example. Also note that we can specify the colour of the error bars, or other parameters
# that arrows() recognizes.
x <- rnorm(20)
y <- x + rnorm(20)
se <- runif(20, 0.2,0.4)
plot(x,y,pch=21,bg="white",panel.first=add_errorbars(x,y,se,direction="updown", col="darkgrey"))

RemkoDuursma/plover documentation built on May 9, 2019, 9:39 a.m.