rSum21 | R Documentation |
Generates a vector of uniformly distributed random numbers which sum to 1.
rSum21(size, digits = NULL)
size |
a non-negative integer giving the number of numbers to generate. |
digits |
integer indicating the number of decimal places to be used. |
a vector of length size with elements drawn
Andri Signorell <andri@signorell.net>
runif
, (Dirichlet distribution)
# generate 5 numbers
x <- rSum21(5)
sum(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.