Hi, set.seed(285) dat1<- as.data.frame(matrix(sample(c(-3:30),10*100,replace=TRUE),ncol=10)) dat2<- dat1[!rowSums(dat1<0),] head(dat1,3) # V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 #1 21 19 16 24 11 -1 4 13 18 -3 #2 3 13 13 29 16 29 16 18 12 12 #3 13 22 14 25 9 19 13 30 6 6
head(dat2,3) # V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 #2 3 13 13 29 16 29 16 18 12 12 #3 13 22 14 25 9 19 13 30 6 6 #11 23 20 5 27 1 24 18 18 26 14 A.K. ________________________________ From: Vivek Das <vd4mm...@gmail.com> To: arun <smartpink...@yahoo.com> Sent: Tuesday, September 3, 2013 10:34 AM Subject: Hi Arun, I would like to know if you have any idea of any function in R by which you can only extract rows from a data frame having only positive values. Is there any way to do it? ---------------------------------------------------------- Vivek Das PhD Student in Computational Biology Giuseppe Testa's Lab European School of Molecular Medicine IFOM-IEO Campus Via Adamello, 16 Milan, Italy emails: vivek....@ieo.eu vchris...@yahoo.co.in vd4mm...@gmail.com ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.