search for: oldfactor

Displaying 1 result from an estimated 1 matches for "oldfactor".

Did you mean: lbfactor
2002 Feb 15
2
Reordering factor levels
I would like to define the order of the levels of a factor. The relevel function would work but since I have 20 levels I would prefer to declare the order explicitly. Using a smaller example levels(oldfactor) "b1" "b2" "r1" "r2" nufactor <- order(oldfactor,order=c("b1","r1","b2","r2")) # my fabricated function levels(nufactor) "b1" "r1" "b2" "r2" Thanks in advance for any help. R...