The function runique(size, total) gives the same output as sample(total, size, replace = FALSE) considering total as an integer. This function is preferable over sample when taking a small sample of a large population.
Usage
runique(size, total)
Arguments
size
non-negative integer giving the number of items to choose.
total
the size of the population as a positive integer, i.e. the length n in 1:n over which to sample.