Code
recipe(~., data = mtcars) %>% step_bin2factor(all_logical_predictors(),
ref_first = 1)
Condition
Error in `step_bin2factor()`:
! `ref_first` must be `TRUE` or `FALSE`, not the number 1.
Code
prep(rec3, training = covers)
Condition
Error in `step_bin2factor()`:
Caused by error in `prep()`:
x All columns selected for the step should be double, integer, or logical.
* 1 factor variable found: `description`
Code
rec %>% step_bin2factor(rocks, levels = letters[1:5])
Condition
Error in `step_bin2factor()`:
x `levels` should be a 2-element character string.
i 5 elements were supplied; two were expected.
Code
rec %>% step_bin2factor(rocks, levels = 1:2)
Condition
Error in `step_bin2factor()`:
x `levels` should be a 2-element character string.
i It was an integer vector.
Code
bake(rec, mtcars)
Condition
Error in `step_bin2factor()`:
! The following required column is missing from `new_data`: bin.
Code
rec
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Operations
* Dummy variable to factor conversion for: <none>
Code
rec
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
outcome: 1
predictor: 10
-- Training information
Training data contained 32 data points and no incomplete rows.
-- Operations
* Dummy variable to factor conversion for: <none> | Trained
Code
print(rec2)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 1
-- Operations
* Regular expression dummy variable using: "(rock|stony)"
* Regular expression dummy variable using: "(rock|stony)"
* Dummy variable to factor conversion for: rocks
Code
prep(rec2)
Message
-- Recipe ----------------------------------------------------------------------
-- Inputs
Number of variables by role
predictor: 1
-- Training information
Training data contained 40 data points and no incomplete rows.
-- Operations
* Regular expression dummy variable using: "(rock|stony)" | Trained
* Regular expression dummy variable using: "(rock|stony)" | Trained
* Dummy variable to factor conversion for: rocks | Trained
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.