Random Sampling
Randomly select records given a probability weight vector prob
.
NOTE: This is an internal function used for testing the C++-function randSample
which is used inside the C++-function recordSwap()
.
randSample_cpp(ID, N, prob, IDused, seed)
ID
: vector containing record IDs from which to sampleN
: integer defining the number of records to be sampledprob
: a vector of probability weights for obtaining the elements of the vector being sampled.IDused
: vector containing IDs which must not be sampledseed
: integer setting the sampling seed