I have a csv file and I load the data in df
.
time d e f id
1 -0.3813535 -0.3766915 1.2365178 a
2 -0.5192448 -0.8325136 0.7229763 a
3 0.3292604 -0.3832252 1.2250516 b
4 0.5438868 -1.1085977 1.3113659 b
5 -0.6883436 -1.9918862 0.5804269 a
6 0.7651908 -0.6465595 1.1116675 b
7 0.8359222 -0.1933391 2.3156759 a
8 1.5074557 -0.1650911 2.3737362 b
9 0.7095554 2.2623272 3.0409351 a
10 0.7137618 2.7033626 2.5880434 b
Actually I want to take 2 plots for id
a and b.
What I have until now are plot for time
library(ggplot2)
library(reshape)
df <- melt(df , id = 'time')
ggplot(df, aes(time,value)) + geom_line() + facet_grid(series ~ .)
Update data format:
time d id
1 -0.3813535 a
2 -0.5192448 a
3 0.3292604 b
4 0.5438868 b
5 -0.6883436 a
6 0.7651908 b
7 0.8359222 a
8 1.5074557 b
9 0.7095554 a
10 0.7137618 b