knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

QREcon

The goal of QREcon is to be simple alternative to doing QR decomposition in R that is intuitive and easy to use.

AppVeyor build status Travis build status Coverage status

Installation

You can install the released version of QREcon from github with:

devtools::install_github("jimb3/QREcon")

Example

This is a example showing how to use QREcon returning a list:

## example returning a list with Q and R
library(QREcon)
# matrix to perform QR decomposition on
x <- matrix(c(1.,1.,1.,2.,3.,5.), 3, 2)
# call to QR decomposition routine
qr <- QREcon(x)
# view result, if q and r are NUll decomposition failed
qr
# checks if result is correct
# should be x
qr$q %*% qr$r
# should be identity matrix
t(qr$q) %*% qr$q

This is a example showing how to use QREcon when result in stored in matrices passed to the routine:

library(QREcon)
# same matrix as in other example
x <- matrix(c(1.,1.,1.,2.,3.,5.), 3, 2)
# allocate memory for q and r
q <- matrix(0., 3, 2)
r <- matrix(0., 2, 2)
# call QR decomposition routine
QREcon(x, q, r)
# display q and r. Should be same as above.
q
r


jimb3/QREcon documentation built on May 7, 2019, 6:08 a.m.