2012-06-04 40 views

回答

7

你可以试试功能qr( “QR”,因为它进行了QR decomposition):在

#define a matrix for this example 
M <- matrix(data = rnorm(12), ncol = 3) 

#run the function qr() 
qr(M)$rank 

#Alternative: load the Matrix package... 
require(Matrix) 

#...and run the function rankMatrix() 
rankMatrix(M)[1]