Re: [R] Converting sparse matrix to data.frame in Matrix package

2010-08-19 Thread David Winsemius
2 2 3 3 > c[order(r)] [1] 4 1 2 3 5 > v[order(r)] [1] 1 2 1 3 1 -- David. -Original Message- From: Phil Spector To: erickso...@aol.com Cc: r-help@r-project.org Sent: Thu, Aug 19, 2010 7:35 pm Subject: Re: [R] Converting sparse matrix to data.frame in Matrix package This se

Re: [R] Converting sparse matrix to data.frame in Matrix package

2010-08-19 Thread ericksonsm
) -Original Message- From: Phil Spector To: erickso...@aol.com Cc: r-help@r-project.org Sent: Thu, Aug 19, 2010 7:35 pm Subject: Re: [R] Converting sparse matrix to data.frame in Matrix package This seems to work, although it eliminates the sparseness of the storage: > dimname

Re: [R] Converting sparse matrix to data.frame in Matrix package

2010-08-19 Thread Phil Spector
This seems to work, although it eliminates the sparseness of the storage: dimnames(a) = list(NULL,letters[1:5]) as.data.frame(as.matrix(a)) a b c d e 1 0 0 0 1 0 2 2 1 0 0 0 3 0 0 3 0 1 - Phil Spector Statistic