On 17-Jan-09 02:57:13, Jörg Groß wrote:
> Hi,
> I have a problem with the R syntax.
> It's perhaps pretty simple, but I don't understand it ...
> 
> I can extract a column from a data.frame with the following code
> for example ...
> 
> b$row1[b$row1 == "male"]
> 
> so I see all male-entries.
> 
> But I cannot extract all lines of a data.frame depending on this  
> criterium;
> 
> only.male <- b[b$row1 == "male"]
> 
> With that, I get an "undefined columns selected" message.
> 
> So how can I extract lines of a data.frame depending on a level  
> variable?

  only.male <- b[b$row1 == "male",]

should work.
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <ted.hard...@manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 17-Jan-09                                       Time: 09:48:43
------------------------------ XFMail ------------------------------

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to