Skip to contents

Convert data.table's factor to one-hot encoding in-place

Usage

dt_set_one_hot(x, xname = NULL, verbosity = 1L)

Arguments

x

data.table.

xname

Character, optional: Dataset name.

verbosity

Integer: Verbosity level.

Value

The input, invisibly, after it has been modified in-place.

Author

EDG

Examples

if (FALSE) { # \dontrun{
ir <- data.table::as.data.table(iris)
# dt_set_one_hot operates in-place; therefore no assignment is used:
dt_set_one_hot(ir)
ir
} # }