error.bars: Plots error bars on a barplot

View source: R/error.bars.R

error.barsR Documentation

Plots error bars on a barplot

Description

Adds error bars to a barplot.

Usage

error.bars(x,y,upper,lower=upper,length=0.1,...)

Arguments

x

Command to produce a barplot (saved as an object).

y

Vector of heights of bars (same as vector given as height argument to barplot).

upper

Vector of upper confidence interval to plot as error bars.

lower

Vector of lower confidence interval to plot as error bars (defaults to symmetrical error bars but can be specified separately for lower and upper confidence intervals to enable asymmetrical error bars to be plotted).

length

Width of floor and ceiling of error bars in inches (not the length of the confidence interval, just an aesthetic choice), passed to arrows().

...

Arguments to be passed to arrows() to customise appearance of error bars.

Author(s)

Kevin Arbuckle

Examples

means<-c(4,5,7,11)
ci<-c(0.5,1.2,0.7,1)
x<-barplot(means,main="",ylim=c(0,15),ylab="Mean number of things",xlab="Colours",
names.arg=c("Blue","Red","Yellow","Black"),cex.lab=1.5,col=c("blue","red","yellow","black"))
error.bars(x,y=means,upper=ci,col="grey30")

windex documentation built on Oct. 11, 2023, 5:16 p.m.

Related to error.bars in windex...