## generate sample data
set.seed(1234)
n <- 12
p <- 5
X <- matrix(rnorm(n * p), n, p)
## get the thin QR factorization
output <- qr_thin(X = X)
Q <- output$Q
R <- output$R
## check
max(abs(Q %*% R - X))
Run the code above in your browser using DataLab