Description Usage Arguments Value Examples
If replace = TRUE
and all = TRUE
, sampling length(x)
of items without replacement first,
then sampling with replacement
1 |
x |
Either a vector of one or more elements from which to choose, or a positive integer |
size |
a non-negative integer giving the number of items to choose |
replace |
Should sampling be with replacement? |
prob |
A vector of probability for obtaining the elements of the vector being sampled |
all |
If |
For sample a vector of length size with elements drawn from either x or from the integers 1:x.
1 | sample_all(1:5, 6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.