I have this df(A)
col1 col2 index
1 2 1
2 76 1
3 0 1
4 0 1
5 0 1
6 0 1
7 0 2
8 0 2
9 0 2
10 0 2
11 NA 2
12 NA 2
I wolud like to convert the col1 in a sequence of time, with year and month, with 3 month interval,based on column index, like this:
col1 col2 index
gen-1975 2 1
feb-1975 76 1
mar-1975 0 1
gen-1976 0 1
feb-1976 0 1
mar-1976 0 1
gen-1975 0 2
feb-1975 0 2
mar-1975 0 2
gen-1976 0 2
feb-1976 NA 2
mar-1976 NA 2
I tried with ts
and as.Date
, but i haven't the expected results
Thank you in advance.