[R] problem subsetting a data frame

Steve Lianoglou mailinglist.honeypot at gmail.com
Fri Feb 4 03:35:01 CET 2011


Hi,

On Thu, Feb 3, 2011 at 8:54 PM, Pete Brecknock <Peter.Brecknock at bp.com> wrote:
>
> try
>
> subset(D, D$x < 5|D$y < 5)

Or even better:

R> subset(D, x < 5 | y < 5)

(The column names of D are "in scope" as variables within the call to
subset(D, ...)

-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list