Some day I may figure out how ggplot2 works.
I am trying to plot 5 columns of data on a graph (similar to a simple matplot)
===
library(ggplot2)
bmi <- structure(list(pct = 2:21, P10 = c(14.6, 14.5, 14.2, 13.9, 13.7,
13.7,
Thanks to both of you.
I knew it was something stupid. I just didn't realise it was that stupid.
--- On Mon, 9/14/09, baptiste auguie wrote:
> From: baptiste auguie
> Subject: Re: [R] ggplot2 graphing multiple lines of data
> To: "R R-help"
> Received: Monday
alternatively, use aes_string,
p <- ggplot(bmm, aes_string(x="age", y="bm", colour="pp", group="pp"))
p <- p + geom_line()
p
HTH,
baptiste
2009/9/14 smu
> hey,
>
> On Mon, Sep 14, 2009 at 07:51:42AM -0700, John Kane wrote:
> > p <- ggplot(bmm, aes(x="age", y="bm", colour="pp", group="pp"))
hey,
On Mon, Sep 14, 2009 at 07:51:42AM -0700, John Kane wrote:
> p <- ggplot(bmm, aes(x="age", y="bm", colour="pp", group="pp"))
> p <- p + geom_line()
remove the quotes and it will work:
ggplot(bmm, aes(x=age, y=bm, colour=pp, group=pp))+geom_line()
regards,
Stefan
___
4 matches
Mail list logo