RE: [R] transform large matrix into list

2005-06-07 Thread Huntsinger, Reid
TECTED] On Behalf Of Liaw, Andy Sent: Tuesday, June 07, 2005 9:42 AM To: 'Stefan Mischke'; r-help@stat.math.ethz.ch Subject: RE: [R] transform large matrix into list Here's one way to do it: > M x1 x2 y1 1 2 y2 4 5 y3 7 8 > (L <- cbind(v=c(M), x=c(col(M)), y=c(row(M)

Re: [R] transform large matrix into list

2005-06-07 Thread james . holtman
.ch> cc: Sent by: Subject: [R] transform large matrix into list

RE: [R] transform large matrix into list

2005-06-07 Thread Jim Brennan
M To: r-help@stat.math.ethz.ch Subject: [R] transform large matrix into list Dear List I need to transform a large matrix M with many NAs into a list L with one row for each non missing cell. Every row should contain the cell value in the first column, and its coordinates of the matrix in column 2

RE: [R] transform large matrix into list

2005-06-07 Thread Liaw, Andy
Here's one way to do it: > M x1 x2 y1 1 2 y2 4 5 y3 7 8 > (L <- cbind(v=c(M), x=c(col(M)), y=c(row(M v x y [1,] 1 1 1 [2,] 4 1 2 [3,] 7 1 3 [4,] 2 2 1 [5,] 5 2 2 [6,] 8 2 3 (The seemingly extraneous c()'s are to drop the dimensions of those matrices.) Are you sure your L[3, 3]

Re: [R] transform large matrix into list

2005-06-07 Thread Dimitris Rizopoulos
itris.htm - Original Message - From: "Stefan Mischke" <[EMAIL PROTECTED]> To: Sent: Tuesday, June 07, 2005 2:55 PM Subject: [R] transform large matrix into list Dear List I need to transform a large matrix M with many NAs into a list L with one row for each no

Re: [R] transform large matrix into list

2005-06-07 Thread Stefan Mischke
Ok, ok, I got it! Please don't laugh! My question is the example from the posting guide! Which even includes the answer. How embarrassing... Stefan Am 07.06.2005 um 14:55 schrieb Stefan Mischke: Dear List I need to transform a large matrix M with many NAs into a list L with one row for e

[R] transform large matrix into list

2005-06-07 Thread Stefan Mischke
Dear List I need to transform a large matrix M with many NAs into a list L with one row for each non missing cell. Every row should contain the cell value in the first column, and its coordinates of the matrix in column 2 and 3. M: x1 x2 y1 1 2 y2 4 5 y3