samedi 28 octobre 2017

Ifelse with multiple condition on date object and ouput as difference between to dates using R

I want to create sequential from 2/1/2016 to 12/1/2017. If opendate of issue is less than equal to 1/1/2016 and fixeddate is greater than equal to 2/1/2016 then difference between opendate1 and 1/1/2016 in days else 0

All the dates are in %m/%d/%Y format

It should give ouput like below;

Open_DateTime OPEN_MONTH FIX_MONTH 2/1/2016 3/1/2016 /1/2016 1/30/2016 1/1/2016 2/1/2016 1.32 0.00 0.00 1/31/2016 1/1/2016 2/1/2016 0.09 0.00 0.00 1/12/2015 1/1/2015 3/1/2016 384.01 413.01 0.00 12/10/2015 12/1/2015 10/1/2017 52.27 81.27 112.27

Aucun commentaire:

Enregistrer un commentaire