powered by
SampleOne() is a fast alternative to sample() that avoids some checks.
SampleOne()
sample()
SampleOne(x, len = length(x))
SampleOne() returns a length one vector, randomly sampled from x.
x
A vector to sample.
(Optional) Integer specifying length of x.
Martin R. Smith (martin.smith@durham.ac.uk)
SampleOne(9:10) SampleOne(letters[1:4])
Run the code above in your browser using DataLab