Re: [R] working with sparse matrix

2011-06-21 Thread davefrederick
Patrick, thank you. This works. I can't believe I have wasted several hours in front of computer for something this easy! :)) 2011/6/21 Patrick Breheny [via R] < ml-node+3614530-1847060061-246...@n4.nabble.com> > On 06/21/2011 09:48 AM, davefrederick wrote: > > Hi, I have

[R] working with sparse matrix

2011-06-21 Thread davefrederick
Hi, I have a 500x 53380 sparse matrix and I am trying to dichotomize it. Under sna package I have found event2dichot yet it doesnt recognize sparse matrix and requires adjacency matrix or array. I tried to run a simple loop code for (i in 1:500) for (j in 1:53380) if (matrix[i,j]>0) matrix[i,j]