randSample_cpp: Random Sampling

View source: R/RcppExports.R

randSample_cppR Documentation

Random Sampling

Description

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

Usage

randSample_cpp(ID, N, prob, IDused, seed)

Arguments

ID

vector containing record IDs from which to sample

N

integer defining the number of records to be sampled

prob

a vector of probability weights for obtaining the elements of the vector being sampled.

IDused

vector containing IDs which must not be sampled

seed

integer setting the sampling seed


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