Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-28 Thread Kevin Wright
Doh, can't believe I missed that. Sorry Bert. On Tue, Jan 27, 2015 at 5:08 PM, Bert Gunter gunter.ber...@gene.com wrote: Well, the OP already referred to segplot. But, see, he shouldn't be doing this plot in the first place. Yes, I know it's fairly standard in science, but it's a bad idea

Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-27 Thread Kevin Wright
See segplot in the latticeExtra package. Kevin On Mon, Jan 26, 2015 at 7:58 PM, Jun Shen jun.shen...@gmail.com wrote: Dear list, I have a couple of lines (superimposed) in an xyplot and just want to add error bars to each of the data point. It's been a while since this question was asked

Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-27 Thread Bert Gunter
Well, the OP already referred to segplot. But, see, he shouldn't be doing this plot in the first place. Yes, I know it's fairly standard in science, but it's a bad idea (as are many others, like the infamous dynamite plot). If uncertainty intervals are desired, they should be model based,

Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-27 Thread William Revelle
You might want to look at the examples in error.bars.by in the psych package. Bill On Jan 26, 2015, at 7:58 PM, Jun Shen jun.shen...@gmail.com wrote: Dear list, I have a couple of lines (superimposed) in an xyplot and just want to add error bars to each of the data point. It's been a

Re: [R] How to add error bars to a line xyplot (lattice package)

2015-01-26 Thread Jim Lemon
Hi Jun, Here is one way to do this using the mtcars data set, although there are probably better ways. mtcars$sd-runif(32,1,2) mpgxhp-xyplot(mpg~hp,mtcars, main=Miles per gallon by horsepower, xlab=Horsepower,ylab=Miles per gallon, panel=function(x,y,ulim,llim) { yspace-diff(range(y))/100

[R] How to add error bars to a line xyplot (lattice package)

2015-01-26 Thread Jun Shen
Dear list, I have a couple of lines (superimposed) in an xyplot and just want to add error bars to each of the data point. It's been a while since this question was asked last time. But the segplot from latticeExtra is not straight forward. Just wonder if there is a better way to do this.