Re: [R] removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

2012-05-21 Thread Rui Barradas
7;min', column 9 is removed and it's still a minimum of removals. (Like in any case of a tie.) Hope this helps, Rui Barradas Em 21-05-2012 11:00, Nevil Amos escreveu: Date: Mon, 21 May 2012 00:17:10 +1000 From: Nevil Amos To:r-help@r-project.org Subject: [R] removeing only rows/column

Re: [R] removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

2012-05-21 Thread Gabor Grothendieck
On Sun, May 20, 2012 at 10:54 AM, Gabor Grothendieck wrote: > On Sun, May 20, 2012 at 10:52 AM, Gabor Grothendieck > wrote: >> On Sun, May 20, 2012 at 10:17 AM, Nevil Amos wrote: >>> I have some square matrices with na values in corresponding rows and >>> columns. >>> >>> M<-matrix(1:2,10,10) >>

Re: [R] removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

2012-05-20 Thread peter dalgaard
On May 20, 2012, at 16:37 , Bert Gunter wrote: > Your problem is not well-defined. In your example below, why not > remove rows 1,2,6, and 10, all of which contain NA's? Is the matrix > supposed to be symmetric? Do NA's always occur symmetrically? ...and even if they do, how do you decide whethe

Re: [R] removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

2012-05-20 Thread Gabor Grothendieck
On Sun, May 20, 2012 at 10:52 AM, Gabor Grothendieck wrote: > On Sun, May 20, 2012 at 10:17 AM, Nevil Amos wrote: >> I have some square matrices with na values in corresponding rows and >> columns. >> >> M<-matrix(1:2,10,10) >> M[6,1:2]<-NA >> M[10,9]<-NA >> M<-as.matrix(as.dist(M)) >> print (M)

Re: [R] removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

2012-05-20 Thread Gabor Grothendieck
On Sun, May 20, 2012 at 10:17 AM, Nevil Amos wrote: > I have some square matrices with na values in corresponding rows and > columns. > > M<-matrix(1:2,10,10) > M[6,1:2]<-NA > M[10,9]<-NA > M<-as.matrix(as.dist(M)) > print (M) > >    1 2 3 4 5 6 7 8 9 10 > 1   0  2 1 2 1 NA 1 2  1  2 > 2   2  0 1

Re: [R] removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

2012-05-20 Thread Bert Gunter
Your problem is not well-defined. In your example below, why not remove rows 1,2,6, and 10, all of which contain NA's? Is the matrix supposed to be symmetric? Do NA's always occur symmetrically? You either need to rethink what you want to do or clarify your statement of it. -- Bert On Sun, May 2

[R] removeing only rows/columns with "na" value from square ( symmetrical ) matrix.

2012-05-20 Thread Nevil Amos
I have some square matrices with na values in corresponding rows and columns. M<-matrix(1:2,10,10) M[6,1:2]<-NA M[10,9]<-NA M<-as.matrix(as.dist(M)) print (M) 1 2 3 4 5 6 7 8 9 10 1 0 2 1 2 1 NA 1 2 1 2 2 2 0 1 2 1 NA 1 2 1 2 3 1 1 0 2 1 2 1 2 1 2 4 2 2 2 0 1 2 1 2 1