sample_unique | R Documentation |
sample_unique()
samples from the unique values in the input. If
size
is greater than or equal to the number of input observations, it
ensures that each observations is present at least once. All sampling steps
are uniform random, but the output will only be uniform random for n
<=
number of observations, or n
>> number of observations. This is due to the
switch from sampling with replacement to sampling without replacement once
the sample size is larger than the number of observations.
sample_unique(.x, n)
.x |
The data to sample |
n |
The number of samples to return |
The shuffled input and additional observations
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.