wrong.year <- floor(as.numeric(time(x)))
print(as.numeric(time(x))[240], 20) # 2021.7726, the floor of
which is 2021
print(correctTime(x)[240], 20) # 2022
On Sat, Oct 15, 2022 at 11:56 AM Eric Berger wrote:
> Alternatively
>
> correct.year <- floor(time(x)+1e-6)
&
years for the first observation in a year. This
could be achieved by rounding the near-integer time to integers.
Since users working with dates are expecting to get exact integer years for
the first cycle of a ts, this should be changed. Thank you in advance for
considering a fix.
Yours sincerely,
2 matches
Mail list logo