[R] Changing an unordered factor into an ordered factor

Oliver Gondring olihui at gmx.de
Thu Feb 4 11:58:31 CET 2010


Hi Mathew,

> I'm trying to change an unordered factor into an ordered factor:
> Help


  it's all about reordering the factor levels, right?

Have a look at this one:
http://rwiki.sciviews.org/doku.php?id=tips:data-factors:factors

The third textbox on the page (search for the string: "Reorder factor
levels") provides a piece of sample code for the task. Should be easy to
adapt it to your problem.

Oliver

P.S.: Maybe it's not a bad idea to provide a more readable
transformation of your code next time. What about replacing the whole
'V961327' thing by 'x' for example?



More information about the R-help mailing list