rSum21 {DescTools} | R Documentation |
Random Numbers Adding Up to 1
Description
Generates a vector of uniformly distributed random numbers which sum to 1.
Usage
rSum21(size, digits = NULL)
Arguments
size |
a non-negative integer giving the number of numbers to generate. |
digits |
integer indicating the number of decimal places to be used. |
Value
a vector of length size with elements drawn
Author(s)
Andri Signorell <andri@signorell.net>
See Also
runif
, (Dirichlet distribution)
Examples
# generate 5 numbers
x <- rSum21(5)
sum(x)
[Package DescTools version 0.99.55 Index]