[R] scatter plot: multiple Y variables and error bars

B77S bps0002 at auburn.edu
Wed May 18 06:49:56 CEST 2011


#Hi all, 
#Using the example data that follows, can someone please show me how to get
a scatterplot of points with #error bars in the Y direction. something like
this works for one Y:

xYplot(Cbind(y1, l1, u1) ~x1,  data=y)

#but  this:

xYplot(Cbind(y1, l1, u1) + Cbind(y2, l2, u2)~x1,  data=y)

# doesn't give me what I would have expected, which is both sets of points
to have their respective error # bars.  Any examples would be greatly
appreciated, and I am not partial to xYplot, so please share #anything you
like. 

y1 <- c(1, 1.2, 0.9, 1, 1.2)
u1 <- c(1.3, 1.4, 1.3, 1.2, 1.4)
l1 <- c(0.8, 0.9, 0.85, 0.8, 0.9)
x1 <-  c(1:5)
y2 <- c(1.2, 1.4, 1.2, 1.4, 1.5)
u2 <- c(1.5, 1.8, 1.6, 1.6, 1.7)
l2 <- c(1.1, 1.3, 1.0, 1.2, 1.4)
y <- data.frame(y1,u1,l1,x1)


## thanks ahead of time!

--
View this message in context: http://r.789695.n4.nabble.com/scatter-plot-multiple-Y-variables-and-error-bars-tp3531563p3531563.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list