Re: [R] Removing rows with rowsums==0 (I can't figure this out)

2008-11-20 Thread Sarah Goslee
On Thu, Nov 20, 2008 at 12:28 PM, Gavin Simpson <[EMAIL PROTECTED]> wrote: > But Prof. Ripley has pointed out (off list) that > > ffg[rowSums(ffg) > 0, ] I suggested much the same solution off-list (using apply rather than rowSums, as I'm apparently incapable of remembering the existence of the l

Re: [R] Removing rows with rowsums==0 (I can't figure this out)

2008-11-20 Thread Gavin Simpson
On Thu, 2008-11-20 at 17:08 +, Gavin Simpson wrote: > On Thu, 2008-11-20 at 12:01 -0500, stephen sefick wrote: > > ##I want to remove the rows where the row sums are zero and this is as > > far as I have gotten > > Given your ffg, > > ## the which() call returns row indices for rows with rowS

Re: [R] Removing rows with rowsums==0 (I can't figure this out)

2008-11-20 Thread Gavin Simpson
On Thu, 2008-11-20 at 12:01 -0500, stephen sefick wrote: > ##I want to remove the rows where the row sums are zero and this is as > far as I have gotten Given your ffg, ## the which() call returns row indices for rows with rowSum > 0 ffg[which(rowSums(ffg) > 0, ] does the trick HTH G > > ff

[R] Removing rows with rowsums==0 (I can't figure this out)

2008-11-20 Thread stephen sefick
##I want to remove the rows where the row sums are zero and this is as far as I have gotten ffg <- (structure(list(CD = c(0, 0, 0, 0, 3.125, 0, 0, 0, 0, 1.6, 3.125, 0, 0, 6.25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3.125, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.6, 0, 0, 0, 0, 0, 0, 0, 0, 0