[R] Splitting row in function of time

PEL pierre-etienne.lessard.1 at ulaval.ca
Wed Nov 16 20:41:28 CET 2011

Hello all,

I have a data frame that looks like this:


I would like to know if it's possible to split a single row into two rows
when the time frame between "beg" and "end" overlaps midnight. I want to
compare the frequency of each activity for each day so a row for a phase
that overlaps on two dates unbalances the graphs I create with this data.

>From the original row:


Note: "phasetime" is only a difftime between "end" and "beg".
          "phaseno" and "activity" should stay the same for the two new

Here is a sample of my data that covers a few days:
http://r.789695.n4.nabble.com/file/n4077622/example.txt example.txt 

Thank you to anyone who takes the time to read this and any idea will be


View this message in context: http://r.789695.n4.nabble.com/Splitting-row-in-function-of-time-tp4077622p4077622.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list