rspin | R Documentation |
This is essentially rmultinom
with a different interface.
rspin(n, probs, labels = 1:length(probs))
n |
number of spins of spinner |
probs |
a vector of probabilities. If the sum is not 1, the probabilities will be rescaled. |
labels |
a character vector of labels for the categories |
rspin(20, prob=c(1,2,3), labels=c("Red", "Blue", "Green"))
do(2) * rspin(20, prob=c(1,2,3), labels=c("Red", "Blue", "Green"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.