Learn R Programming

eHDPrep (version 1.3.3)

onehot_vec: One hot encode a vector

Description

Uses one-hot encoding to convert nominal vectors to a tibble containing variables for each of the unique values in input vector.

Usage

onehot_vec(x, prefix)

Value

tibble

Arguments

x

non-numeric vector

prefix

prefix to append to output variable names