Learn R Programming

ff (version 1.0-1)

runique: Sampling unique indices

Description

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.

See Also

sample

Examples

Run this code
seqpack(c(1:5,4,2,seq(2,20,4)))

Run the code above in your browser using DataLab