Description Usage Arguments Details Author(s) See Also Examples
A function for plotting error bars onto barplots.
1 |
graph |
A vector of x-coordinates at which to plot the error bars. Alternatively, an object resulting from barplot() may be used. |
m |
A vector indicating the centers for each error bar (e.g., group means) |
ebl |
A vector indicating the error bar lengths |
sides |
A numeric indicating whether one-sided or two-sided error bars are desired. |
length |
A numeric indicating the length of the "caps" of the error bars |
Plots error bars for barplots, but can be used generically for other error bar plotting.
Ryne A. Sherman
1 2 3 4 5 6 7 8 | #making random data
y1 <- rnorm(30, mean = 5, sd = 1.5)
y2 <- rnorm(30, mean = 8, sd = 1.2)
#simple barplot
mygraph <- barplot(c(mean(y1),mean(y2)), ylim=c(0,10))
#plotting the error bars
library(sciplot) # To get the se() function
e.bars(mygraph, c(mean(y1),mean(y2)), ebl=c(se(y1),se(y2)), sides = 2, length = 0.08)
|
Loading required package: psych
Loading required package: abind
Loading required package: foreach
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.