Error bar in R?

I need a good errorbar function.

I already tried the package (psych), but here I can’t remove the x axis, and I also tried the package (ggplot2), but here I can’t use the second y axis. Can someone recommend me a good package for creating errors in R?

+5
source share
1 answer

see for example ?errbarin the packageHmisc

 group <- factor(sample(1:10,100,T))
y <- (1:10)[group] + rnorm(100)
grmean <- tapply(y,group,mean)
lims <- tapply(y,list(group),FUN = sd)*2
errbar( 1:10, grmean, grmean + lims, grmean - lims , xaxt="n" )
axis(3)

gives: enter image description here

+4
source

All Articles