Hi all, I'm just a beginner in R. I have a pretty basic doubt. This is the actual quote I wrote > x<-factor(c("M","F","M","T","M","T")) > levels(x)=c("M","F","T") > x [1] F M F T F T Levels: M F T > table(x) x M F T 1 3 2
Expectation: I just wanted to change my baselevel from F to M. with the number of M and F remaining constant What exactly happened: The values of F and M also get exchanged along with the change of base level from F to M Best, -- *Anant Saini* ------------------------------ *Indian Institute of Technology Bombay* *Mob: +91 - 9967687330 * *LinkedIn* : *in.linkedin.com/in/anantsaini* <http://in.linkedin.com/in/anantsaini> [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.