Randomly select donor records given a probability weight vector. This sampling procedure is implemented differently than
randSample_cpp to speed up performance of C++-function
NOTE: This is an internal function used for testing the C++-function
sampleDonor which is used inside the C++-function
seed = 123456L
micro data containing the hierarchy levels and household ID
List where each entry corresponds to column indices of variables in
data which should be considered when swapping households.
column index in
data which refers to the household identifier.
vector containing records for which a donor needs to be sampled
set from which `IDswap` was drawn
a vector of probability weights for obtaining the elements of the vector being sampled.
integer setting the sampling seed