Farrel Buchinsky wrote:
> It is easy to index on numeric variables.
> How does one index on a variable that is a factor?
> 


Same as for numeric objects. Example:

R> x <- factor(c("A", "B"))
R> x
[1] A B
Levels: A B

R> x[1]
[1] A
Levels: A B

______________________________________________
R-help@stat.math.ethz.ch 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