arguments imply differing number of rows: 64, 717
Any ideas how to solve this ? I just want to add new data from dataset of different size, however levels of factor Time are the same and it should not matter.
Thanks for help
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/
For your particular case, I'd suggest plotting the two data frames in
different geom_line() layers, something like
ggplot() + geom_line(data = ds1, aes(x = Time, y = Value, colour = Subject)) +
geom_line(data = Average, aes(x = Time, y = Value), size = 1)
# default black color, change it to whatever you wish *outside* the
aes() arguments.
This approach allows you to combine information from different data
sets (with possibly different variable names) in a single plot.
Fortunately, the x and y variable names are the same (with related
information) in the two data frames, so there shouldn't be much
problem in coordinating the two.
However, there is a sneakier way to do this with only the first data
set (using the group = 1 trick to obtain the average line),
illustrated in section 4.9.3 of Hadley's book. Try the last set of
code chunks from the scripts in Chapter 4 of the book,
http://had.co.nz/ggplot2/book/layers.r
Start from here (about 10cm from the bottom):
require(nlme, quiet = TRUE, warn.conflicts = FALSE)
Copy and paste the code from that point on into your R session, one
plot at a time, and see what comes out. It's an instructive chunk of
code.
HTH,
Dennis