Re: [R] strings as factors

2006-12-11 Thread Bill.Venables
male > which(sexf %in% "male") [1] 1 2 > which(sexf == "male") [1] 1 2 Bill Venables -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alexander Nervedi Sent: Tuesday, 12 December 2006 10:09 AM To: r-help@stat.math.ethz.ch Subject: [R]

[R] strings as factors

2006-12-11 Thread Alexander Nervedi
Hi, To be able to match cases with a benchmark I need to have a data.frame with a character id variable. however, I am surprised why this seems to be so hard. In fact I was unable to succeed. Here is what I tried: >test1 <-expand.grid(ID = 1:2, sex = c("male","female")) >is(test1[,2]) [1] "fact