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?

______________________________________________
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