.BG
.FN qr
.FN as.qr
.FN is.qr
.TL
QR Matrix Decomposition
.CS
qr(x, tol = 1e-7)
is.qr(o)
as.qr(o)
.AG x
matrix of numeric data.
Missing values are not allowed.
.AG tol
tolerance for detecting linear dependencies among columns of
`x' (see `rank' below).
.AG o
any S object.
.RT
`qr' returns an object representing the QR numerical decomposition of the
matrix `x'.
The method used is the Householder successive reflection procedure,
adapted from the implementation used by the LINPACK library.
The components of
the returned object are as follows:
.RC qr,qraux
the numerical decomposition itself.
`qr' is a matrix like `x', while `qraux' is a vector of length `ncol(x)'.
.RC rank
the rank of `x' as computed by the decomposition.
(If you really want to estimate the rank, the function `svd' is preferable.)
.RC pivot
the pivoting of columns of `x' used to produce the decomposition.
.PP
`is.qr' returns `TRUE' if its argument has `qr' and `qraux' components,
`FALSE' otherwise.
.br
`as.qr' returns its argument if `is.qr(x)' is `TRUE', and `qr(x)' otherwise.
.SH NOTE
Unlike regression functions, `qr' does not add an intercept term.  Bind
on a column of 1s if you want an intercept.
However, the results of `qr.coef', etc., will reflect an intercept term, if used,
when they take the decomposition as computed by a regression
function.
.SA
`qr.coef', `qr.fitted', `qr.resid', `qr.qty', `qr.qy', `lsfit', `backsolve'.
.EX
q <- qr(state.x77)
.KW algebra
.WR
