Hi,
I am doing an exhaustive sample, of random sizes from a population, say 1:10.
The sample sizes are controlled but the sum of the sample sizes ==
length(population) and the population is reduced by the latest sample at
each pass.
sample(1:10, size) works fine unless at the end, population is of length 1,
then,
per the correct operation of sample(), I get, not the last digit but an
integer between 1 and the last digit. So, I must continually test for that
condition.
Is there a smarter way to reshuffle this deck into discreet units?
thanks,
john
John Fennick
jhf2@adelphia.net
Tel: 603.526.4023
134 Brookside Drive
New London, NH 03257
USA
|