Simulate spinning a spinner
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"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.