on 07/22/2008 08:47 AM 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
Thanks a lot!
See ?subset and ?Logic
DF.new <- subset(DF, (gender == "female") & (age > 50))
Remail@example.com mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.