[R] Question on levels function and extracting the associated level number

2010-09-25 Thread Jeffrey Cexun Cai
Dear Sir/Madam, I have a quick question, which I hope someone can help. I am using the levels function in R, which helps to summarize the number of factors that I have in a vector in an ordered manner. Using an already existing example: state - c(tas, sa, qld, nsw, nsw, nt, wa, wa,

Re: [R] Question on levels function and extracting the associated level number

2010-09-25 Thread Jorge Ivan Velez
Jeffrey, You can try as.numeric(state) [1] 6 5 4 2 2 3 8 8 4 7 2 7 4 4 5 6 5 3 8 7 4 2 2 8 5 1 2 7 7 1 HTH, Jorge On Sat, Sep 25, 2010 at 5:51 PM, Jeffrey Cexun Cai wrote: Dear Sir/Madam, I have a quick question, which I hope someone can help. I am using the levels function in