Hi,

 

I have the following data frame, where col2 is a startdate and col3 an
enddate

 

COL1      COL2      COL3

A             40462    40482

B             40462    40478

 

The above timeframe of 3 weeks I would like to splits it in weeks like this

COL1      COL2      COL3      COL4

A             40462    40468    1

A             40469    40475    1

A             40476    40482    1

B             40462    40468    1

B             40469    40475    1

B             40476    40478    0.428

 

Where COL4 is an identifier if the timeframe between COL2 and COL3 is
exactly 7 days or shorter. 

In the example above for B the last split contains only 3 days so the value
in COL 4 is 3/7

 

I can't figure out to do the above. Is there someone who can help me out? 

 

Thx in advance,

Bert


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to