Learn R Programming

rtemis (version 1.4.3)

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

Description

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

Usage

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

Value

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

Arguments

x

data.table: Input data.table. Will be modified in-place.

xname

Character, optional: Dataset name.

verbosity

Integer: Verbosity level.

Author

EDG

Examples

Run this code
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

Run the code above in your browser using DataLab