Description Usage Arguments Value Examples
View source: R/variableencoding.R
This function takes a vector of items and onehot encodes them into a data.frame which in reality is a tibble. Every unique value of the vector get converted into a column and the value is 1 for that column if the row number matches the position in the original vector. See the examples for details.
1 | oneHotEncoder(x, f = function(y) y)
|
x |
the vector to convert to a one hot |
f |
a function to apply to x before encoding which defaults to identity |
the one hot encoded data.frame with the original data given in a Data column
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.