[R] how to drop rows from a data.frame

2004-06-30 Thread Peter Wilkinson
here is a snippet of data where I would like to drop all rows that have zeros across them, and keep the rest of the rows while maintaining the row names (1,2,3, ...10). The idea here is that a row of zeros is an indication that the row must be dropped. There will never be the case where there

Re: [R] how to drop rows from a data.frame

2004-06-30 Thread Patrick Connolly
On Wed, 30-Jun-2004 at 11:57PM -0400, Peter Wilkinson wrote: | here is a snippet of data where I would like to drop all rows that have | zeros across them, and keep the rest of the rows while maintaining the row | names (1,2,3, ...10). The idea here is that a row of zeros is an indication |

Re: [R] how to drop rows from a data.frame

2004-06-30 Thread Peter Wilkinson
You right its a matrix (I ran an is.matrix() on my object). Thanks, Peter At 12:13 AM 7/1/2004, Patrick Connolly wrote: On Wed, 30-Jun-2004 at 11:57PM -0400, Peter Wilkinson wrote: | here is a snippet of data where I would like to drop all rows that have | zeros across them, and keep the rest of

Re: [R] how to drop rows from a data.frame

2004-06-30 Thread Gabor Grothendieck
Assuming all the entries are non-negative and non-NA this will do it: DF[rowSums(DF) 0,] Peter Wilkinson pwilkinson at videotron.ca writes: : : here is a snippet of data where I would like to drop all rows that have : zeros across them, and keep the rest of the rows while maintaining

Re: [R] how to drop rows from a data.frame

2004-06-30 Thread Peter Wilkinson
Thanks for everyone's help, there seems to be many ways of solving the problem that work well. Peter At 12:36 AM 7/1/2004, Gabor Grothendieck wrote: Assuming all the entries are non-negative and non-NA this will do it: DF[rowSums(DF) 0,] Peter Wilkinson pwilkinson at videotron.ca writes: :