maybe a easy question but I cannot figure out. That's my original df:
Date.time P ID
1 2013-07-03 11:15:00 1207.7 K0904
2 2013-07-03 11:20:00 1207.7 K0904
3 2013-07-03 11:25:00 1207.9 K0904
4 2013-07-03 11:30:00 1208.0 K0904
5 2013-07-03 11:35:00 1208.0 K0904
....
70 2013-07-03 17:00:00 1208.6 K0955
71 2013-07-03 17:05:00 1208.4 K0955
72 2013-07-03 17:10:00 1208.4 K0955
73 2013-07-03 17:15:00 1208.6 K0955
74 2013-07-03 17:20:00 1208.8 K0955
...
And with this code
ggplot(df1, aes(x=Date.time, y=P, group=ID, color=ID)) +
geom_line() +
facet_grid(~ID) +
theme(legend.position="none")
I create this plot
Simply I want to overlay the last 3 plots to the first 3 ones (so the plot is smaller and more readable. I tried to split the df into 2 ones, each one made by 3 ID and then combine them adding 2 geom_line()
one for every df but nothing changed. Any idea?
Code to extract the new df is:
df1<-subset(df, ID %in% c("K1142", "K0904", "K1136"))
df2<-subset(df, ID %in% c("K0955", "K1148", "K8651"))
and then the new attempt
ggplot(df1, aes(x=Date.time, y=P, group=ID, color=ID)) +
geom_line() +
geom_line(data=df2, aes(x=Date.time, y=P, color=ID)) +
facet_grid(~ID) +
theme(legend.position="none")