Learn R Programming

radiant.model (version 1.6.7)

onehot: One hot encoding of data.frames

Description

One hot encoding of data.frames

Usage

onehot(dataset, all = FALSE, df = FALSE)

Arguments

dataset

Dataset to endcode

all

Extract all factor levels (e.g., for tree-based models)

df

Return a data.frame (tibble)

Examples

Run this code
head(onehot(diamonds, df = TRUE))
head(onehot(diamonds, all = TRUE, df = TRUE))

Run the code above in your browser using DataLab