Takes samples in the usual manner
sample2.Rd
The standard sample function in R samples from n numbers when x = n. This is unwanted behavior when the size of the vector to sample from changes dynamically. This is corrected in sample2
Examples
sample(x = 10,size = 5,replace = TRUE)
#> [1] 10 1 2 4 1
sample2(x = 10,size = 5,replace = TRUE)
#> [1] 10 10 10 10 10