Skip to content
Prev 24883 / 63424 Next

(PR#9623) qr.coef: permutes dimnames; inserts NA; promises

I see it in svn:

       if(!is.null(nam <- colnames(qr$qr)))
  -       rownames(coef) <- nam
  +        if(k < p) rownames(coef)[qr$pivot] <- nam
  +        else rownames(coef) <- nam
  +

Thank you!
OK, I accept that.
OK, I understand qr.coef indicates with NA that dcrdc2 decided to
exclude the corresponding columns (because of linear dependency).

I still think the documentation is misleading -- trimming to the essence:
(A)
'qr.solve' and 'solve.qr' will NOT handle under-determined systems.
They both perform this check:

    if (a$rank != nc) 
        stop("singular matrix 'a' in solve")

But 'qr.coef', which they call when all is well, does.

(B)
Help promises a minimal-length solution, but QR does not deliver that.
Maybe the phrase "a minimal-length solution or" should be removed?

/Christian Brechbuehler