Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Bar in R? [closed]

Tags:

r

ggplot2

I am in need for a good errorbar function.

I have already tried the package(psych) but in here I can't remove the x axis and I also tried the package(ggplot2) but in here I can't use a second y-axis. Can anybody recommend me a good package for making errorbars in R?

like image 295
Sir Ksilem Avatar asked Oct 11 '22 05:10

Sir Ksilem


1 Answers

see eg ?errbar in the package Hmisc

 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

like image 179
Joris Meys Avatar answered Oct 14 '22 04:10

Joris Meys