This function generates a random observation from a multinomial distribution.
Total size (and NOT the number of variables involved in the multinomial distribution).
Vector of probabilities. The sum of all its elements must be one.
A vector with the sample which has been generated.
for(i in 1:10) print(rmultin(10, c(1/3, 1/3, 1/3) ))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.