I have some data in a single dataframe. It represents several days' worth of data broken down by age within each day. What I'm looking to do is plot the Value (data points) for each age (y axis) by day (x axis). The frame is set up like this:
Age day Value
1 13 15 139
2 14 15 198
3 15 15 287
4 16 15 404
5 17 15 439
6 18 15 323
7 19 15 255
8 13 16 135
9 14 16 202
10 15 16 309
11 16 16 380
12 17 16 451
13 18 16 366
14 19 16 256
15 13 17 117
16 14 17 208
17 15 17 303
18 16 17 392
19 17 17 410
20 18 17 359
21 19 17 246
Thus, 13 would plot from 139 to 135 to 117 over the three day period. I'm trying to use ggplot2, and am having trouble with the syntax. The end result should plot lines with different color by age.
So far I've tried this:
ggplot(d, aes(x=day, y=Age, color=Value, group=Age)) + geom_line()
But this yields an empty plot and this error message: geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?
What am I missing?
