Re: [R] Matrix transformation problem

2008-06-11 Thread Berend Hasselman
stefan.petersson wrote: > > > ng, > > I have a matrix (x) with binary content. Each row of the matrix holds > exactly one 1, and the rest of the row is zeros. The thing is that I need > to 'collapse' the matrix to one column where each row holds the original > column index of the 1's (y). Som

Re: [R] Matrix transformation problem

2008-06-11 Thread Ted Harding
e - > From: <[EMAIL PROTECTED]> > To: > Sent: Wednesday, June 11, 2008 10:10 AM > Subject: [R] Matrix transformation problem > > >> >> ng, >> >> I have a matrix (x) with binary content. Each row of the matrix >> holds exactly one 1, and the

Re: [R] Matrix transformation problem

2008-06-11 Thread Eik Vettorazzi
you may try a matrix multiplication, which has a very high performance in R x%*%1:ncol(x) hth. [EMAIL PROTECTED] schrieb: ng, I have a matrix (x) with binary content. Each row of the matrix holds exactly one 1, and the rest of the row is zeros. The thing is that I need to 'collapse' the ma

Re: [R] Matrix transformation problem

2008-06-11 Thread Dimitris Rizopoulos
June 11, 2008 10:10 AM Subject: [R] Matrix transformation problem ng, I have a matrix (x) with binary content. Each row of the matrix holds exactly one 1, and the rest of the row is zeros. The thing is that I need to 'collapse' the matrix to one column where each row holds the ori

Re: [R] Matrix transformation problem

2008-06-11 Thread Dimitris Rizopoulos
uven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm - Original Message - From: <[EMAIL PROTECTED]> To: Sent: Wednesday, June 11, 2008 10:10 AM

[R] Matrix transformation problem

2008-06-11 Thread stefan . petersson
ng, I have a matrix (x) with binary content. Each row of the matrix holds exactly one 1, and the rest of the row is zeros. The thing is that I need to 'collapse' the matrix to one column where each row holds the original column index of the 1's (y). Sometimes, the matrix is quite large, so I h