[R] How to filter a data frame?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Jul 22 16:19:57 CEST 2008


John Kane wrote:
> ?subset
>
> Is this what you want? 
>
> subset(dataset, gender="M" | age < 50) 
>
>   
In case you didn't see it: Make that

gender == "M"  |  age < 50

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list