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


sdcMicro documentation built on Sept. 27, 2023, 5:07 p.m.