[R] change factor labels

From: Sebastian Leuzinger <Sebastian.Leuzinger_at_unibas.ch>
Date: Tue 18 Oct 2005 - 20:19:34 EST


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

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 Received on Tue Oct 18 20:30:44 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:45 EST