0

I have the data frame as I have below. I want to examine all Intake frequencies with "03 Month". My mission is to remove any Intake that is far away from three months by comparing the dates. Intake stands for when a client first register with an agency. 03 Month is three months follow up.

I am running R version 3.3.2 in Window environment.

I have taking the difference between the current date and the previous date in days. However, it is not straight forward to eliminate the observation with less than 90 days and greater than say 100 days as some patient has only intake and no follow up which i will like to keep.

Any help please.

ID  DATE            FREQ
1   08/09/2014      Intake
1   27/03/2015      Intake
1   01/09/2015      Intake
1   07/12/2015      03 Months
1   18/03/2016      06 Months
thelatemail
  • 91,185
  • 12
  • 128
  • 188
  • 1
    Your question isn't clear. Are you trying to filter out all entries where `CURRENT_DATE - DATE` is less than `FREQ`? – haitham Nov 28 '16 at 23:24
  • Please consider several suggestions: (1) provide sample data (in a usable format, such as with `dput`); (2) provide code you've tried and any errors it shows; (3) read [reproducible examples](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and [help/mcve](http://stackoverflow.com/help/mcve); (4) "accept" answers to questions you've posted, as a "thank you" to those who have helped. – r2evans Nov 28 '16 at 23:38
  • What differentiates the patients? Is it simply the case that the data are listed chronologically, and each new occurrence of "Intake" signifies a new patient? – jdobres Nov 28 '16 at 23:39
  • What do you mean by "to eliminate the observation with less than 90 days and greater than say 100 days" ? – user31264 Nov 29 '16 at 00:44

0 Answers0