Learn R Programming

PEIP (version 2.2-5)

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)

Value

integer, number of non-zero singular values

Arguments

G

Matrix

tol

machine tolerance for small numbers

Author

Jonathan M. Lees<jonathan.lees@unc.edu>

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