plotCI {sfsmisc} | R Documentation |
THIS IS NOW (2004-08-12) DEPRECATED !!!
DO USE plotCI
from package gplots INSTEAD!
Given a set of x and y values and upper and lower bounds, this function plots the points with error bars. Can be used for confidence interval visualization as well.
plotCI(x, y = NULL, uiw, liw = uiw, aui = NULL, ali = aui, err = "y", xlim = NULL, ylim = NULL, type = "p", log = "", sfrac = 0.01, gap = 0, add = FALSE, col = par("col"), lwd = par("lwd"), slty = par("lty"), scol = col, pt.bg = NA, xlab = NULL, ylab = NULL, main = "", axes = TRUE, ...)
x |
the x coordinates of points in the plot |
y |
the y coordinates of points in the plot |
uiw |
the width of the upper portion of the confidence region,
or (if liw is missing) the width of both halves of
the confidence region |
liw |
the width of the lower portion of the confidence region (if missing, the function assumes symmetric confidence bounds) |
aui |
the absolute upper limit of the confidence region |
ali |
the absolute lower limit of the confidence region |
err |
character giving the direction of error bars: "x"
for horizontal, "y" for vertical ("xy" would be nice
but is not implemented yet). |
xlim |
x limits of the plot |
ylim |
y limits of the plot |
type |
point/line type; passed to points |
log |
character indicating if log scales should be use in x or y;
passed to plot.default() . |
gap |
size of gap in error bars around points (default 0) |
sfrac |
scaling factor for the size of the serifs (end bars) on
the confidence bars, in x-axis units |
add |
logical; if FALSE (default), create a new plot; if TRUE, add error bars to an existing plot. |
col |
color of points |
lwd |
line width of error bars |
slty |
line type of error bars |
scol |
color of error bars |
pt.bg |
background color of points (use
pch=21, pt.bg=par("bg") to get open points superimposed on
error bars). |
xlab, ylab |
horizontal and vertical axis labels. |
main |
main title, see plot.default or
title . |
axes |
logical indicating if axes should drawn, see
plot.default . |
... |
any other parameters to be passed through to
plot . |
None.
Fixes for logarithmic axes; simultaneous horizontal and vertical error bars. The main problem is figuring how parameters should be specified.
The package gregmisc has been containing another extension of
Ben's original posting with the same name
plotCI
. We should really merging the two
versions into Greg's one, i.e., eventually deprecate this version (of
package sfsmisc).
Ben Bolker bolker@zoo.ufl.edu (documentation and tweaking of a function provided by Bill Venables)
y <- runif(10) err <- runif(10) plotCI(1:10,y,err) plotCI(1:10,y,err,2*err,lwd=2,col="red") err.x <- runif(10) err.y <- runif(10) plotCI(1:10,y,err.y,pt.bg=par("bg"),pch=21) plotCI(1:10,y,err.x,pt.bg=par("bg"),pch=21,err="x",add=TRUE)