Date time series with multiple observations per date | How to set a date to be zero

Viewed 15

I date a dataset with id 1:n date "2017-01-01" to "2021-01-01", monthy data Outcome value

I want to create an vector where "2020-03-01" is 0(zero) and "2020-02-01" is -1 and so on... also "2020-04-01" is 1 and so on...

if you could provide some help with code example in R, I would very gratefull

0 Answers
Related