discretize_variable: Discretize Continuous Variable

View source: R/discretize_variable.R

discretize_variableR Documentation

Discretize Continuous Variable

Description

Converts a data.table column from continuous to a discrete factor

Usage

discretize_variable(data, variable, num_cats, breakpoints = NULL)

Arguments

data

data.table, containing the column to change

variable

character, the name of the column to change

num_cats

integer, the number of bins to generate

breakpoints

numeric vector, the breakpoints to use. If NULL, these will be quantiles.

Value

the updated data.table, modified in place


jeremyrcoyle/tmle3 documentation built on May 20, 2022, 7:36 a.m.