how to identify time overlap in r
问题 I have a dataframe (df) with admission and discharge dates of patients, with 4 columns: ID, admitDate (as date), dcDate (as date), los (length of stay in days). $ admitDate : Date, format: "2009-09-19" "2010-01-24" "2010-09-30" ... $ dcDate : Date, format: "2009-09-23" "2010-01-27" "2010-10-04" ... $ los : num 4 3 4 25 6 3 6 2 2 3 ... I need to be able to tell at any given time how many patients (and which patients) were admitted. That is, I think I need to find out the overlap between the