Some languages that recognized early design mistakes introduced a
strict mode, which applies to a local context, and enforces a safer,
more consistent API. This is a pragmatic solution, as it does not
require any changes to existing code, but still allows writing better
code in the future.
Impleme
Yes, both are rooted in age-old design infelicities (in which, basically,
interactive expedience has taken precedence over consistency 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 whic
ptember 17, 2018 12:22:31 PM
To: li...@revelle.net
Cc: r-devel
Subject: Re: [Rd] diag(-1) produces weird result
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 gi
On Mon, Sep 17, 2018 at 5:22 PM, Gábor Csárdi
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,]
On 17/09/2018 12:14 PM, William Revelle wrote:
Dear list
A strange bug in the psych package is due to the behavior of the diag function:
It gives the expected values for 1, a vector (-1,1), but not for -1
Is this a known feature?
It is pretty clearly documented:
"diag has four distinct usag
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,]100
[2,]010
[3,]001
Of course this
Dear list
A strange bug in the psych package is due to the behavior of the diag function:
It gives the expected values for 1, a vector (-1,1), but not for -1
Is this a known feature?
> diag(1)
[,1]
[1,]1
> diag(c(-1,1))
[,1] [,2]
[1,] -10
[2,]01
> diag(-1)
Error in