mercredi 1 juin 2016

R code to compute missing months to an end date

I'm trying to run a web visit analysis locked to the end date of a subscription contract. Here is an example of my data in a csv file: enter image description here

I need to do the following: 1. based on the enddateM value (the month in which the contract has been renewed), I need to derive the time-to-the-end-date. to make it simple, if the enddateM is 12 (December), then Nov-14 needs to be labeled as "-1 month" (create a new column), Oct-14 as "-2 months" and so on backward. I would also like to have the values copied in the new column. so the value in the Nov-14 column should be copied in the "-1 month" column. I have NO idea of how I am supposed to do that on R, is there an easy way to do it? Thanks

Aucun commentaire:

Enregistrer un commentaire