distributeRandom_cpp: Distribute

View source: R/RcppExports.R

distributeRandom_cppR Documentation

Distribute

Description

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().

Usage

distributeRandom_cpp(inputRatio, totalDraws, seed)

Arguments

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


sdcTools/sdcMicro documentation built on March 15, 2024, 12:32 p.m.