Re: [R] Unintended behaviour of stats::time not returning integers for the first cycle

2022-10-18 Thread Andreï V . Kostyrka
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) &

[R] Unintended behaviour of stats::time not returning integers for the first cycle

2022-10-15 Thread Andreï V . Kostyrka
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,