Sample Random Integers from Particular Range in R (Example Code)
In this R tutorial you’ll learn how to draw random integers from a range.
Example: Draw Unique Random Integer Values from Interval without Replacement
set.seed(2893755) # Random seed for reproducibility |
set.seed(2893755) # Random seed for reproducibility
sample.int(n = 100, size = 20) # Sample integers between 1-100 # [1] 78 4 82 39 64 43 7 42 35 98 41 79 14 63 55 92 83 68 88 21 |
sample.int(n = 100, size = 20) # Sample integers between 1-100 # [1] 78 4 82 39 64 43 7 42 35 98 41 79 14 63 55 92 83 68 88 21