TreeTools (version 0.1.3)

SampleOne: Quick sample

Description

Faster than inbuilt sample because it avoids some checks.

Usage

SampleOne(x, len = length(x))

Arguments

x

A vector to sample.

len

(optionally) integer specifying length of x.

Value

A vector of length one, randomly sampled from x.

Examples

Run this code
# NOT RUN {
SampleOne(9:10)
SampleOne(letters[1:4])

# }

Run the code above in your browser using DataLab