[R] How to delete rows using conditions on all columns

markheckmann mark.heckmann at gmx.de
Mon Oct 24 16:20:48 CEST 2011


If you don't mind using a loop, e.g. like this:

x <- mydata
qs <- sapply(x, function(x) quantile(x, c(0.01, 0.99)))
for (i in 1:ncol(x))
  x <- subset(x, x[ ,i] >= qs[1,i] & x[ ,i] <= qs[2,i])

--
View this message in context: http://r.789695.n4.nabble.com/How-to-delete-rows-using-conditions-on-all-columns-tp3932027p3933256.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list