[R] How to filter a data frame?

Roland Rau roland.rproject at gmail.com
Tue Jul 22 17:10:34 CEST 2008


Hi,

rlearner309 wrote:
> I have a question about how to filter the data frame:
> Suppose my data frame has variables like gender, age,... How to get a subset
> of the data frame, with only female (or male) and/or age > 50...?  What is
> the typical syntax?  I tried several condition expressions, but none of them
> worked...
> 
> Thanks a lot!

I guess the other people answered the question already.
But may I ask if your background is in SPSS?
I just had this impression talking about 'filter' and the unique way of 
using 'syntax'.

Best,
Roland

P.S. The first statistical software I used was SPSS and I would have 
asked in exactly the same way when I started using R. :-)



More information about the R-help mailing list