Generates a random sample of participant IDs without replacement.

random.sample(popsize, samsize)

Arguments

popsize

study population size

samsize

sample size

Value

Returns a vector of randomly generated participant IDs

Examples

random.sample(3000, 25)
#>  [1]  196  291  536  560  591  628  693  701  714  974  981 1204 1213 1257 1428
#> [16] 1430 1546 1549 1948 2073 2333 2365 2692 2815 2974

# Should return:
#  [1]   37   94  134  186  212  408  485  697  722  781  998 1055 
# [13] 1182 1224 1273 1335 1452 1552 1783 1817 2149 2188 2437 2850 2936