I would suggest using zoo or xts packages (which relies on zoo
). Using these time formats, you can define time series with or without daylight saving time or a leap year.
In addition, I would suggest using the lubridate package to do time calculations. lubridate
makes the difference between periods and duration.
The duration class measures the exact time interval between two points in time that you would measure on a stopwatch.
In contrast to the period , for example, "month". But how long does a month last? Depends on which month you have in mind. And, for example, in leap years, the month of February has a different duration, but the same length of the period.
Whether you require a duration or period depends on your subject and purpose. With zoo
and lubridate
you can choose the one that suits you.
source share