Re: [R] order() with randomised order in ties?

2009-06-04 Thread Rainer M Krug
On Thu, Jun 4, 2009 at 12:36 PM, Patrick Burns pbu...@pburns.seanet.com wrote: How about: order(x, runif(length(x))) Thanks - that is really elegant. Rainer Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the

Re: [R] order() with randomised order in ties?

2009-06-04 Thread Rainer M Krug
On Thu, Jun 4, 2009 at 12:45 PM, Rainer M Krug r.m.k...@gmail.com wrote: On Thu, Jun 4, 2009 at 12:36 PM, Patrick Burns pbu...@pburns.seanet.com wrote: How about: order(x, runif(length(x))) Thanks - that is really elegant. One thing: it is saver to use sample(length(x)) instead of