ra_one_of | R Documentation |
This function samples a value from a discrete distribution.
ra_one_of(x, p = NULL, n = 1)
x |
vector of categories |
p |
vector of probabilities |
n |
Number of samples |
A vector of values sampled form the distribution specified
ra_one_of(x = c("one", "two", "3"), p = c(0.2, 0.3, 0.5), n = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.