random_percents: Return a vector of random proportions/percents that sum to...

View source: R/random_percents.R

random_percentsR Documentation

Return a vector of random proportions/percents that sum to 1/100

Description

Useful to split a data value into random parts that will sum back to the total.

Usage

random_percents(.bin = NULL, .seed = NULL)

Arguments

.bin

numeric; the number of bins to generate.

.seed

numeric; the seed for randomly generating numbers.

Examples

# With default seed value (1)
random_percents(.bin = 2)

# With specific seed value (45)
random_percents(.bin = 2, .seed = 45)

# With specific seed value (45) and more bins (9)
random_percents(.bin = 9, .seed = 45)


mike-decarlo/caser documentation built on March 14, 2023, 9:54 a.m.