It is easy to index on numeric variables. How does one index on a variable that is a factor? -- Farrel Buchinsky, MD Pediatric Otolaryngologist Allegheny General Hospital Pittsburgh, PA
"Farrel Buchinsky" <fjbuch at gmail.com> writes:> It is easy to index on numeric variables. > How does one index on a variable that is a factor?Er, same way. Unless you attach some novel meaning to "index on". Example? -- 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
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