Re: [R] plotEst

From: hadley wickham <h.wickham_at_gmail.com>
Date: Sat, 23 Feb 2008 11:51:39 -0600

On Tue, Feb 19, 2008 at 3:53 PM, sigalit mangut-leiba <smangut_at_gmail.com> wrote:
> 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()

An easier way would be to do something like this:

df1$id <- 1
df2$id <- 2
df <- rbind(df1, df2)

qplot(se, or, min=lcl1, max=ucl1, colour=factor(id), data=df, geom="pointrange") +
geom_line()

That way you get a nice legend too.

Hadley

-- 
http://had.co.nz/

______________________________________________
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 Sat 23 Feb 2008 - 18:09:17 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 - 23: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