View source: R/barplot_errbar.R
barplot_errbar | R Documentation |
To plot data, just use it as a normal barplot but add the errbar.y values or errbar.y.minus, errbar.y.plus if bars for y axis are asymetric. Use y.plus and y.minus to set absolut limits for error bars. Note that y.plus and y.minus have priority over errbar.y, errbar.y.minus and errbar.y.plus.
barplot_errbar(
...,
errbar.y = NULL,
errbar.y.plus = NULL,
errbar.y.minus = NULL,
y.plus = NULL,
y.minus = NULL,
errbar.tick = 1/50,
errbar.lwd = par("lwd"),
errbar.lty = par("lty"),
errbar.col = par("fg"),
add = FALSE
)
... |
Parameters for barplot() such as main= or ylim= |
errbar.y |
The length of error bars for y. Recycled if necessary. |
errbar.y.plus |
The length of positive error bars for y. Recycled if necessary. |
errbar.y.minus |
The length of negative error bars for y. Recycled if necessary. |
y.plus |
The absolut position of the positive error bar for y. Recycled if necessary. |
y.minus |
The absolut position of the nagative error bar for y. Recycled if necessary. |
errbar.tick |
Size of small ticks at the end of error bars defined as a proportion of total width or height graph size. |
errbar.lwd |
Error bar line width, see par("lwd") |
errbar.lty |
Error bar line type, see par("lwd") |
errbar.col |
Error bar line color, see par("col") |
add |
If true, add the graph to the previous one. |
barplot_errbar plot a barplot with error bar on y
A numeric vector (or matrix, when beside = TRUE), say mp, giving the coordinates of all the bar midpoints drawn, useful for adding to the graph.
If beside is true, use colMeans(mp) for the midpoints of each group of bars, see example.
Marc Girondot marc.girondot@gmail.com
plot_errorbar
Other plot and barplot functions:
ScalePreviousPlot()
,
plot_add()
,
plot_errbar()
,
show_name()
## Not run:
barplot_errbar(rnorm(10, 10, 3),
xlab="axe x", ylab="axe y", bty="n",
errbar.y.plus=rnorm(10, 1, 0.1), col=rainbow(10),
names.arg=paste("Group",1:10), cex.names=0.6)
y <- rnorm(10, 10, 3)
barplot_errbar(y,
xlab="axe x", ylab="axe y", bty="n",
y.plus=y+2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.