I have some date that I am trying to convert them to numbers and then back to original date.
Date
1990-12-31
1991-12-31
1992-12-31
1993-12-31
1994-06-30
1994-12-31
I tried,
as.numeric(DF[1:6])
[1] 1 2 3 5 7
as.Date(as.numeric(DF[1:6]), "1990-12-31")
[1] "1991-01-01" "1991-01-02" "1991-01-03" "1991-01-05" "1991-01-07" "1991-01-08"
I notice the problem of time interval. What should I do to get original dates?