[R] filtering data frame based on two columns

sun flyhyena at yahoo.com.cn
Fri Jan 11 13:26:15 CET 2008

"sun" <flyhyena at yahoo.com.cn> wrote in message 
news:fm7mtb$tqk$1 at ger.gmane.org...
> Hi,
> I have a data frame df with column names a,b and c.
sorry for some typos.

should be subdf = df[df$a==1,]
subdf = df[df$a==1 && df$b ==2,]

More information about the R-help mailing list