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

2006-11-30 Thread Prof Brian Ripley
On Wed, 29 Nov 2006, Petr Pikal wrote: On 29 Nov 2006 at 12:08, Peter Dalgaard wrote: Date sent:Wed, 29 Nov 2006 12:08:21 +0100 From: Peter Dalgaard [EMAIL PROTECTED] To: Wolfram Fischer [EMAIL PROTECTED] Copies to:

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

2006-11-29 Thread Wolfram Fischer
What is the reason, that the levels of the factor returned by cut() are not marked as ordered levels? is.ordered( cut( breaks=3, sample(10 ) ) ) FALSE help(factor) ... If 'ordered' is 'TRUE', the factor levels are assumed to be ordered. ... Wolfram

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

2006-11-29 Thread Petr Pikal
Hi it is not stated that the cut shall return ordered factor. If you want you can use ordered(cut( breaks=3, sample(10 ) )) or modify code for cut.default to accept ordered switch. HTH Petr On 29 Nov 2006 at 9:59, Wolfram Fischer wrote: Date sent: Wed, 29 Nov 2006 09:59:36

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

2006-11-29 Thread Bjørn-Helge Mevik
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

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

2006-11-29 Thread Peter Dalgaard
Wolfram Fischer wrote: What is the reason, that the levels of the factor returned by cut() are not marked as ordered levels? is.ordered( cut( breaks=3, sample(10 ) ) ) FALSE It would arguably be the Right Thing, but there would be complications in modeling, where ordered

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

2006-11-29 Thread Petr Pikal
On 29 Nov 2006 at 12:08, Peter Dalgaard wrote: Date sent: Wed, 29 Nov 2006 12:08:21 +0100 From: Peter Dalgaard [EMAIL PROTECTED] To: Wolfram Fischer [EMAIL PROTECTED] Copies to: r-help@stat.math.ethz.ch Subject:Re: