Description Usage Arguments Value See Also Examples
Generate a random vector without replacement.
1 | r_sample_replace(n, x = 1:100, prob = NULL, replace = FALSE, name = "Sample")
|
n |
The number elements to generate. This can be globally set within
the environment of |
x |
A vector of elements to chose from. |
prob |
A vector of probabilities to chose from. |
replace |
logical. If |
name |
The name to assign to the output vector's |
Returns a random vector of elements.
1 2 3 4 |
[1] 64 79 68 95 15 14 90 78 61 32 64 19 31 45 34 98 61 79 62 3 27 96 96 69 30
[26] 23 78 59 91 79 60 85 22 59 87 85 27 15 18 37 29 75 36 25 77 64 98 77 12 75
[51] 97 6 28 74 69 8 23 98 43 87 55 68 82 49 82 95 6 65 35 56 43 48 27 9 54
[76] 61 95 15 51 17 93 54 42 44 41 49 72 52 64 95 36 70 92 88 80 24 40 62 5 6
Bird Cat Dog Fish
251 235 268 246
[1] "B" "W" "B" "B" "B" "W" "B" "B" "B" "B" "B" "B" "B" "W" "B" "B" "B" "B" "W"
[20] "B" "W" "W" "B" "B" "B"
[1] FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE
[13] TRUE FALSE TRUE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
[25] TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.