Description Usage Arguments Examples
Create numeric encoder, that turns factor variables into integers.
1 | encode_numeric(vars = factors)
|
vars |
Function or formula that returns selected columns from a data.frame. Alternatively, character vector of column names. |
1 2 3 4 5 6 | df <- data.frame(A=c("a1","a1","a2","a3"), B=c("b1", "b2", "b3", "b4"), X=c(1,2,3,4))
prep <- encode_numeric(~select(., A))
prep$fit(df)
prep$transform(df)
# or more succintly
prep$fit_transform(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.