s-news
[Top] [All Lists]

Re: random permutations (was random number)

To: asanquer@virbac.fr
Subject: Re: random permutations (was random number)
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
Date: Fri, 24 Oct 2003 08:16:41 +0100 (BST)
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <OFBBD813FD.FC8144B7-ONC1256DC9.0026F306-C1256DC9.00278222@virbac.fr>
?sample tells you how.

sample(100) will do it for you.

On Fri, 24 Oct 2003 asanquer@virbac.fr wrote:

> I have a quiet simple problem, but I can't find the solution.
> I would like to generate a sample,componed of all integers between 1 and
> 100, but randomly distributed.
> But I don't want to have repetition: each number must appear, but only one
> time.
> 
> I try :
> 
> round(runif(100)*100,digits=0)
> 
> but this command provides me a sample with some repetition (the number 60
> could appear twice for example).

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


<Prev in Thread] Current Thread [Next in Thread>
  • random number, asanquer
    • Re: random permutations (was random number), Prof Brian Ripley <=