[R] Rank of Matrix

Thomas Lumley tlumley at u.washington.edu
Tue Feb 19 17:45:29 CET 2002


On Tue, 19 Feb 2002, Indrajit SenGupta wrote:

> Hello everybody,
> I think my question has been asked before but I am posing it once again
> since I need it. Is there any way to find the rank of a matrix in R or
> Splus?

yes, it has been asked quite recently.

You can use either qr(), there's an example in help(qr) or use svd() and
count the number of non-zero singular values. Deciding the right tolerance
for counting a singular value as zero is not trivial -- any matrix is
arbitrarily close to full rank matrices in almost any reasonable metric.

	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list