[R] ReShape chicks example - line plots

Mark Knecht markknecht at gmail.com
Tue Jul 7 00:55:51 CEST 2009


On Mon, Jul 6, 2009 at 2:45 PM, Mark Knecht<markknecht at gmail.com> wrote:
<SNIP>
>
> 1) I think it's displaying all the chicks, not just the chicks on diet
> 1. I presume that this is because you chose group=chick from chick_m
> but when I went to the qplot help page I didn't find group documented.
> Is that an oversight in the help file or does that come in some other
> way?
>
> To get just diet=1 do I need to melt/cast the data first as in these
> other methods I'm trying out?
>

diet.1 <- subset(chick_m, diet==1)
qplot(time, value, data = diet.1, group = chick,
 colour = as.numeric(as.character(chick)) %% 2, geom = "line")

solved that one. I should have known that. A quick drive in the car
solves a few problems.

>
> 2) It is making some very strange choices for the legend, printing
> as.numeric(as.character(chick)) %% 2 and showing numbers 0, 0.2, 0.4,
> 0.6, 0.8 & 1. I presume you see the same thing?
>

I'll study how the legend title gets set.

thanks,
Mark




More information about the R-help mailing list