1

I have a data frame of start time, end time in UNIX time stamp and category, as below:

enter image description here

I want to find the overlaps of one category say "a" among other categories "b" & "c" and same for other categories. I want to find how many number of categories overlapped how many times e.g. 2 categories overlapped 3 times and 3 categories overlapped 5 number of time. And also the average of duration they overlapped for as shown below.

enter image description here

user6559913
  • 483
  • 4
  • 7
  • 15
  • What did you try so far? Maybe have a look at `?data.table::foverlaps` – Rentrop Jul 28 '16 at 13:06
  • 2
    Please provide a minimal and reproducible example (http://stackoverflow.com/help/mcve). – Alex Jul 28 '16 at 13:14
  • @Floo0 : I tried doing this through creating if and else condition on start and end for two categories at a time and I also tried IRanges/Genomic Ranges but I am not able to get the result since there are too many categories. Thanks for suggesting "foverlaps" but again it takes two categories at a time and it will take huge time for all categories taken one by one on 4 months data. – user6559913 Jul 28 '16 at 14:01
  • @Alex: I do not have a reproducible example for this. – user6559913 Jul 28 '16 at 14:04
  • Can't you create one? – Alex Jul 28 '16 at 14:15

0 Answers0