Learn R Programming

PEIP (version 1.7)

rnk: Rank of Matrix

Description

Return the rank of a matrix. Not to be confused with the R function rank.

Usage

rnk(G, tol = 1e-14)

Arguments

G
Matrix
tol
machine tolerance for small numbers

Value

  • integer, number of non-zero singular values

Details

Number of singular values greater than tol.

See Also

svd

Examples

Run this code
hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
X <- hilbert(9)[,1:6]
rnk(X)

Run the code above in your browser using DataLab