powered by
Generate a random vector of probabilities that sum to 1.
probs(j, upper = 1e+06)
An integer of number of probability elements (typically performs best at j < 4000).
probs works by sampling from 1:upper j times and then dividing each sample by the sum of all samples.
probs
1:upper
Returns a vector of probabilities summing to 1.
# NOT RUN { probs(10) sum(probs(100)) pie(table(month(10000, prob = probs(12)))) # }
Run the code above in your browser using DataLab