.factorize_variable {valueSetCompare}R Documentation

.factorize_variable

Description

This function factorizes a numeric variable in a data frame based on a specified variant function and optional breaks.

Usage

.factorize_variable(df, weight_column, variant_fun, breaks = NULL)

Arguments

df

A data frame containing the variable to be factorized.

weight_column

A string specifying the name of the column in the data frame that contains the variable to be factorized.

variant_fun

A function that will be applied to the variable for factorization.

breaks

An optional numeric vector specifying the breakpoints for cutting the variable, if applicable.

Value

A factor or numeric vector representing the factorized variable.


[Package valueSetCompare version 1.0.0 Index]