distributeRandom_cpp | R Documentation |
Distribute 'totalDraws' using ratio/probability vector 'inputRatio' and randomly round each entry up or down such that the distribution results in an integer vector.
Returns an integer vector containing the number of units in 'totalDraws' distributetd according to proportions in 'inputRatio'.
NOTE: This is an internal function used for testing the C++-function distributeRandom
which is used inside the C++-function recordSwap()
.
distributeRandom_cpp(inputRatio, totalDraws, seed)
inputRatio |
vector containing ratios which are used to distribute number units in 'totalDraws'. |
totalDraws |
number of units to distribute |
seed |
integer setting the sampling seed |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.