I'm very new to R so please be gentle.
I have a dataset containing timestamps and some data. Now I'd like to draw a graph where:
- The data is grouped by e.g. 60 mins intervals and
- some percentile lines are drawn.
I'd like to have a graph with the time as x-axis and the gap as y-axis. I imagine something like boxplot but for a better overview - since I have a long measurement - instead of boxes I'd like to have lines that connect the
- mean values,
- 3 percentiles,
- 97 percentiles and
- 100 percentiles
Here's an example data:
> head(B, 10)
times gaps
1 2013-06-10 15:40:02.654168 1.426180
2 2013-06-10 15:40:18.936882 2.246462
3 2013-06-10 15:40:35.215668 3.227132
4 2013-06-10 15:40:48.328785 1.331284
5 2013-06-10 15:40:53.809485 1.294128
6 2013-06-10 15:41:04.027745 2.292671
7 2013-06-10 15:41:25.876519 1.293501
8 2013-06-10 15:41:42.929280 1.342166
9 2013-06-10 15:42:11.700626 3.203901
10 2013-06-10 15:42:23.059550 1.304467
I can use cut to divide the data:
C <- table(cut(B, breaks="hour"))
or
C <- data.frame(cut(B, breaks="hour"))
But how can I draw the graph form this? I don't know how to access the gap values of the groups. Otherwise I could
quantile(C$gaps, c(.03, .5, .97, 1))
Thanks in advance for any help Ramon