Displaying 2 results from an estimated 2 matches for "newbehaviour".
2018 Sep 17
2
diag(-1) produces weird result
On Mon, Sep 17, 2018 at 5:22 PM, G?bor Cs?rdi <csardi.gabor at gmail.com>
wrote:
> I would say it is a mis-feature. If the 'x' argument of diag() is a
> vector of length 1, then it creates an identity matrix of that size,
> instead of creating a 1x1 matrix with the given value:
>
> ? diag(3)
> [,1] [,2] [,3]
> [1,] 1 0 0
> [2,] 0 1 0
2018 Sep 18
0
diag(-1) produces weird result
...istency and generality).
Unfortunately, they are quite difficult to rectify, because there are bound to be countless uses of, say, diag(5) as a 5x5 identity matrix which would break if it suddenly meant the 1x1 matrix(5) instead.
We'd need a very carefully orchestrated warn-deprecate-defunct-newBehaviour sequence, with a time scale of years, most likely. It is, in principle, doable (I think), but we don't really have the mechanisms to follow through on it. Almost all developers have main job responsibilities, and it is very easy to get sidetracked at the wrong moment, so most changes get done...