0

I have a dataset with worker curriculum with:

  • 2 time variable: df$from and df$to
  • 1 name variable: df$name
  • 1 bureau variable: df$bureau

I would like to generate a varible df$varable which sum 1 point every time there is an intersection of time for different person in the same bureau. I am able to do intersect(df$from, df$to) but not to condition on df$bureau.

  • 2
    Welcome to StackOverflow. Please take a look at these tips on how to produce a [minimum, complete, and verifiable example](http://stackoverflow.com/help/mcve), as well as this post on [creating a great example in R](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). Perhaps the following tips on [asking a good question](http://stackoverflow.com/help/how-to-ask) may also be worth a read. – lmo Sep 06 '17 at 16:59
  • `intersect` doesn't work the way you think it does. It gives the intersection of two discrete sets, not interval overlaps. Look into the `lubridate` package for handling time intervals. – Nathan Werth Sep 06 '17 at 17:12
  • @Nathanwerth thank you very much, but i look into lubridate but i can't nonetheless handle the problem – Damiano Argan Sep 06 '17 at 20:03

0 Answers0