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

2022-10-15 Thread Eric Berger
Alternatively correct.year <- floor(time(x)+1e-6) On Sat, Oct 15, 2022 at 10:26 AM Andreï V. Kostyrka < andrei.kosty...@gmail.com> wrote: > Dear all, > > > > I was using stats::time to obtain the year as a floor of it, and > encountered a problem: due to a rounding error (most likely due to its

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

2022-10-15 Thread Andreï V . Kostyrka
Dear all, I was using stats::time to obtain the year as a floor of it, and encountered a problem: due to a rounding error (most likely due to its reliance on the base::seq.int internally, but correct me if I am wrong), the actual number corresponding to the beginning of a year X can still be (X-