R-beta: qr(A)$rank

Bertram Zinner (zinnebe@mail.auburn.edu)
Tue, 24 Feb 98 15:07:46 -0600


Message-Id: <199802242105.PAA02418@mallard.duc.auburn.edu>
Subject: R-beta: qr(A)$rank
Date: Tue, 24 Feb 98 15:07:46 -0600
From: Bertram Zinner <zinnebe@mail.auburn.edu>
To: <r-help@stat.math.ethz.ch>

I would like to find the rank of a matrix using R. Looking through a list 
of commands it seems that the command qr should do the job. Checking a 
simple example gave me the wrong answer. Here is the example: 

> A <- c(1,2,3,4,5,6)
> A <- matrix(A, nrow=2, ncol=3)
> A
     [,1] [,2] [,3]
[1,]    1    3    5
[2,]    2    4    6
> qr(A)$rank
[1] 3

The correct answer is two.

I should add that I am using the mac version of R. Any suggestions? --- 
Bertram
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._