Re: [R] plotEst

From: sigalit mangut-leiba <smangut_at_gmail.com>
Date: Tue, 19 Feb 2008 23:53:54 +0200

Sorry to disturb,
I managed to plot 2 together with 'layer' like this:

qplot(se, or, min=lcl1, max=ucl1, data=df1, geom="pointrange")+layer(data = df2, mapping = *aes*(x = se, y = OR2,min=lcl2,max=ucl2), geom = "pointrange")+geom_line()
My only problem is that It doesn't plot the line (geom_line) for the layer, only the estimate points and conf. limits. It does plot a line for the first set of data defined in 'qplot'. The information from the web site: http://had.co.nz/ggplot2 helps a lot. Thank you,
Sigalit.

On 2/19/08, sigalit mangut-leiba <smangut_at_gmail.com> wrote:
>
> Sorry,
> I want to plot 2 lines (or pointrange like I used before) together, with
> confidence limits of the estimates.
> I want to plot another curve as I did for the first one (with qplot like
> you suggested).
> I know how to do it with ggplot *without* confidence limits:
>
> SE<-c(0.6,0.7,0.8,0.9)
>
> OR<-c(2.745,2.103,1.665,1.311,1.189,1.009,0.852,0.7)
>
> lcl<-c(1.894,1.456,1.155,0.911,0.824,0.698,0.587,0.481)
>
> ucl<-c(4,3.05,2.411,1.905,1.723,1.465,1.24,1.025)
>
> df<-data.frame(SE, OR, lcl, ucl, Z=gl(2,4))
>
> ggplot(data=df, aes(x=SE, y=OR, colour=Z))
> + geom_line()
> As I said, I get 2 lines without conf. limits, which i want to add. Thank
> you for your reply,
> Sigalit.
>
>
> On 2/19/08, hadley wickham <h.wickham_at_gmail.com> wrote:
> >
> > > Another question: Can I add another line to the same plot with qplot?
> > > (like function "lines" in "plot").
> >
> > Yes.
> >
> > (if you want more details, tell us what you're trying to do!)
> >
> > Hadley
> >
> >
> > --
> > http://had.co.nz/
> >
>
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 19 Feb 2008 - 21:56:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 23 Feb 2008 - 18:30:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive