Skip to contents

Sample allocation

Usage

sample_allocation(prob)

Arguments

prob

[numeric(C)]
The vector of class probabilities.

Value

An integer 1:C.

Examples

sample_allocation(c(0.5, 0.3, 0.2))
#> [1] 1