?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
|