onehot: One-Hot encode a dataframe

Description Usage Arguments Value Examples

View source: R/onehot.R

Description

One-hot encodes a dataframe whose features are all categorical

Usage

1
onehot(encodable_df)

Arguments

encodable_df

data.frame A dataframe of categorical features.

Value

data.frame Returns the same dataframe with useful column names and one-hot encoded features

Examples

1
2
my_data <- data.frame(animals = c('monkey', 'dog', 'cat'))
onehot(my_data)

UBC-MDS/PrepR documentation built on April 2, 2020, 3:55 a.m.