qr.X(qrstr, complete=F, ncol=) qr.Q(qrstr, complete=F, Dvec=1) qr.R(qrstr, complete=F)
qr.Q returns Q, the order-nrow(X) orthogonal (unitary) transformation represented by qrstr. If complete==T, Q has nrow(X) columns. If complete==F, Q has ncol(X) columns. When Dvec is specified, each column of Q is multiplied by the corresponding value in Dvec.
qr.R returns R, the c(ncol(X),ncol(X)) upper triangular matrix such that X == Q %*% R. If complete==T, R has nrow(X) rows. If complete==F, R has ncol(X) rows. qr.
qrstr <- qr(x) # dim(x) == c(n,p) Q <- qr.Q(qrstr) # dim(Q) == dim(x) R <- qr.R(qrstr) # dim(R) == ncol(x) X <- qr.X(qrstr) # X == x # X == Q %*% R Qc <- qr.Q(qrstr, complete=T) # dim(Qc) == nrow(x) QD <- qr.Q(qrstr, D=seq(p)) # QD == Q %*% diag(D) Rc <- qr.R(qrstr, complete=T) # dim(Rc) == dim(x) Xc <- qr.X(qrstr, complete=T) # Xc[,seq(p)]==x ; dim(Xc)==nrow(x)