licols | R Documentation |
Extract a linearly independent set of columns of a matrix.
licols(X, tol = 1e-10, quiet = FALSE)
X |
A matrix. |
tol |
A tolerance for rank estimation. Default is 1e-10. |
quiet |
logical; if FALSE, print a warning about computation time if |
An R version of a Matlab licols
function given in
this MathWorks forum post.
Xsub
contains the extracted columns of X
and idx
contains the indices (into X) of those columns. The elapsed time is stored in
elapsed.sec
.
x = 0:19 %% 3 + 1
Z = model.matrix(~ as.factor(x) - 1)
X = cbind(1, Z)
licols(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.