[R] Why the factor levels returned by cut() are not ordered?

Bjørn-Helge Mevik bhs2 at mevik.net
Wed Nov 29 10:33:22 CET 2006


Wolfram Fischer wrote:

> What is the reason, that the levels of the factor
> returned by cut() are not marked as ordered levels?

I don't know, but you can always make it ordered with

ordered(cut(breaks = 3, sample(10)))

>> help(factor)
>     ...
>     If 'ordered' is 'TRUE', the factor levels are assumed to be ordered.
>     ...

The help file for factor() probably doesn't tell you much about how
cut() works. :-)

-- 
Bjørn-Helge Mevik



More information about the R-help mailing list