[R] [SPAM] - How can I generate a random order? - Found word(s) remove list in the Text body

davidr at rhotrading.com davidr at rhotrading.com
Wed Nov 12 21:29:10 CET 2008


sample(1:100)


-- David


-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Stuart Leask
Sent: Wednesday, November 12, 2008 2:24 PM
To: r-help at stat.math.ethz.ch
Subject: [SPAM] - [R] How can I generate a random order? - Found word(s)
remove list in the Text body

Feeling very stupid here.

I just want to randomly-ordered some integers, e.g. the numbers 1 to
100, with each element present once only in a random order. 
I suspect I need to randomly sample a population 1-100, remove that
number, then randomly sample what is left until they've all gone,  but I
can't seem to find the right combination of order/sort/sample + runif.

I fear it can't be that hard - has anyone cracked this?

Stuart

Dr Stuart J Leask DM MRCPsych MA BChir
Clinical Senior Lecturer and Honorary Consultant in Clinical Psychiatry
University Dept of Psychiatry, A Floor, Queen's Medical Centre,
Nottingham. NG7 2UH
www: Google "Dr Stuart Leask"
 

This message has been checked for viruses but the contents of an
attachment
may still contain software viruses, which could damage your computer
system:
you are advised to perform your own checks. Email communications with
the
University of Nottingham may be monitored as permitted by UK
legislation.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list