Random Samples and Permutations
sample(x, size, replace = FALSE, prob = NULL) sample.int(n, size = n, replace = FALSE, prob = NULL)
Samples in Normal Distribution
rnorm(n, mean = 0, sd = 1)
Generate Factor Levels
gl(n, k, length = n*k, labels = seq_len(n), ordered = FALSE)
Generate Repeated Numbers
rep(0:1, each = 5) [1] 0 0 0 0 0 1 1 1 1 1