Skip to content
Prev 33028 / 63421 Next

Inverting a square matrix using solve() with LAPACK=TRUE (PR#13765)

rvaradhan at jhmi.edu wrote:
Thanks, but there seems to be a much easier fix.

Inside coef.qr, we have

coef[qr$pivot, ] <-
.Call("qr_coef_real", qr, y, PACKAGE = "base")[seq_len(p)]

which should be [seq_len(p),]

(otherwise, in the matrix case, the RHS will recycle only the 1st p 
elements, i.e., the 1st column).