[Rd] diff(<ts-matrix>), Ops.ts -- R Bugzilla PR#18972

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Wed Mar 4 12:57:47 CET 2026


>>>>> Martin Maechler 
>>>>>     on Wed, 4 Mar 2026 12:42:20 +0100 writes:

>>>>> Suharto Anggono Suharto Anggono 
>>>>>     on Wed, 4 Mar 2026 06:05:18 +0000 (UTC) writes:

    >> Then, please announce the change in NEWS. For example:
    >> The result of arithmetic and comparison operations of non-overlapping "ts" objects where either is a matrix is now a matrix.

    >> It seems that the statement "diff(<ts-matrix>) remains matrix, even when it has length zero" was meant for the change to 'Ops.ts'. But the wording is about diff(<ts-matrix>), which is included in the previous statement.

    >> But I've just realized this :

    >> Suppose that
    >> x <- ts(0)

    >> With the change, x - lag(x, -1) and x == lag(x, -1) are NULL.
    >> In R 4.5.2, x - lag(x, -1) is integer(0) and x == lag(x, -1) is logical(0).

    > Indeed, so we may even have to change R-devel further (for this
    > rare boundary case).

    > But the R 4.5.2   x - lag(x, -1)  giving integer(0)  is only somewhat better than
    > giving NULL  when in principle the "truly correct" answer should
    > be  double(0) and we'd rather get that right in R-devel.

==> So, we should probably reopen R Bugzilla item PR#18972, at
 ---> https://bugs.r-project.org/show_bug.cgi?id=18972

Martin



More information about the R-devel mailing list