[R] change factor labels

Sebastian Leuzinger Sebastian.Leuzinger at unibas.ch
Tue Oct 18 12:19:34 CEST 2005


it must be terribly simple, can someone quickly help me?

test <- data.frame(y=c(1:10), x=as.factor(c(rep("a",5),rep("b",5))))

how can i change the factor labels from "a" and "b" to for example "u"  and 
"v"?

i don't succeed with factor()

thanks a lot

------------------------------------------------
Sebastian Leuzinger
Institute of Botany, University of Basel




More information about the R-help mailing list