how to show an event happened between two dates in R
问题 My question seems simple and I hope it is. I have a dataframe that has the date of diagnosis of a disease, a binary variable indicating which drug the patient was on (or exposed and unexposed group), a start and stop date for the drug, and an overall stop date. ID Diag_date Treatment End.date Drug.start drug.end 1 NA 0 15/03/2002 01/01/2002 01/02/2002 1 NA 1 15/03/2002 01/02/2002 01/03/2002 1 NA 0 15/03/2002 01/03/2002 NA 2 01/04/2002 1 01/05/2002 01/01/2015 01/02/2002 2 01/04/2002 0 01/05