Skip to contents

Deprecated Integerize probability columns by sampling#' @description Converts groups of probability columns to binary indicators by sampling, ensuring each row sums to 1. Use for multinomial assignment from probabilities.

Usage

integerize_probs(input_table, grp_pattern, seed = 1234)

Arguments

input_table

data.table. Input with probability columns to integerize.

grp_pattern

character(1). Regex pattern for columns to sample.

seed

integer(1), optional. RNG seed for reproducibility.

Value

data.table. Copy of input with binary indicator columns.

Details

  • DEPRECATED. Use integerize() or other supported utilities for integerization.

  • This function is deprecated and not used elsewhere in the package.

  • Identifies columns by pattern and samples one per row.

  • Sets sampled column to 1, others to 0.

  • Returns data.table with binary columns.

  • Assumes input is a data.table and probabilities sum to 1.

Settings

None.

See also

integerize

Other weighting utilities: integerize()

Examples

## Not run:
integerize_probs(dt, 'p_', seed = 1234)
#> Error in integerize_probs(dt, "p_", seed = 1234): could not find function "integerize_probs"