[R] How to delete rows from dataframe that sum to zero

ghostwheel lachmann at eva.mpg.de
Thu Apr 26 11:26:44 CEST 2012


Here's an example

a=data.frame( sample(0:1,20,rep=T), sample(0:1,20,rep=T) ) # make 2 random
columns of length 20.
a.no0 = a[ rowSums(a)!=0, ]


--
View this message in context: http://r.789695.n4.nabble.com/How-to-delete-rows-from-dataframe-that-sum-to-zero-tp4589289p4589308.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list