One solution - let's say our data.frame is "xx" Then:
xx <- matrix(rnorm(9), 3,3) apply(xx < 0, 1, any) ----------------Contact Details:------------------------------------------------------- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Fri, Aug 6, 2010 at 4:03 PM, Werner W. <pensterfuz...@yahoo.de> wrote: > Hi, > > I know ways to do this but they all seem awkward and I somehow believe that > there is a convenient shortcut. > > If I have a data.frame with many columns, how can I request all rows for > which > at least one column satisfy an expression? > > For instance, all rows where at least one column is negative. > > Many thanks, > Werner > > > > > ______________________________________________ > 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. > [[alternative HTML version deleted]] ______________________________________________ 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.