Re: [R] Computing the rank of a matrix.

From: Ravi Varadhan <rvaradhan_at_jhmi.edu>
Date: Fri 06 Apr 2007 - 16:44:33 GMT

Hi,

qr(A)$rank will work, but just be wary of the tolerance parameter (default is 1.e-07), since the rank computation could be sensitive to the tolerance chosen.

Ravi.



Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: rvaradhan@jhmi.edu

Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html  



-----Original Message-----

From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of apjaworski@mmm.com Sent: Friday, April 06, 2007 11:07 AM
To: Josť Luis Aznarte M.
Cc: r-help@stat.math.ethz.ch; r-help-bounces@stat.math.ethz.ch Subject: Re: [R] Computing the rank of a matrix.

How about

      qr(A)$rank

or perhaps

      qr(A, LAPACK=TRUE)$rank

Cheers,

Andy



Andy Jaworski
518-1-01
Process Laboratory

3M Corporate Research Laboratory

E-mail: apjaworski@mmm.com
Tel: (651) 733-6092
Fax: (651) 736-3122
                                                                           
             "Josť Luis                                                    
             Aznarte M."                                                   
             <jlaznarte@decsai                                          To 
             .ugr.es>                  r-help@stat.math.ethz.ch            
             Sent by:                                                   cc 
             r-help-bounces@st                                             
             at.math.ethz.ch                                       Subject 
                                       [R] Computing the rank of a matrix. 
                                                                           
             04/06/2007 06:39                                              
             AM                                                            
                                                                           
                                                                           
                                                                           




    Hi! Maybe this is a silly question, but I need the column rank (http://en.wikipedia.org/wiki/Rank_matrix) of a matrix and R function 'rank()' only gives me the ordering of the elements of my matrix.

    How can I compute the column rank of a matrix? Is there not an R equivalent to Matlab's 'rank()'?

    I've been browsing for a time now and I can't find anything, so any help will be greatly appreciated. Best regards!


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat Apr 07 02:47:11 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 07 Apr 2007 - 15:30:58 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.