-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
recipes converts strings to factors without being asked to. #836
Comments
library(recipes)
library(nycflights13)
myrecipes <- recipes::recipe(
formula = arr_delay ~ carrier + distance,
data = flights)
prepped_recipe <- recipes::prep(myrecipes, flights, strings_as_factors = FALSE)
recipes::bake(prepped_recipe, new_data = flights)
#> # A tibble: 336,776 × 3
#> carrier distance arr_delay
#> <chr> <dbl> <dbl>
#> 1 UA 1400 11
#> 2 UA 1416 20
#> 3 AA 1089 33
#> 4 B6 1576 -18
#> 5 DL 762 -25
#> 6 UA 719 12
#> 7 B6 1065 19
#> 8 EV 229 -14
#> 9 B6 944 -8
#> 10 AA 733 8
#> # … with 336,766 more rows Created on 2021-10-13 by the reprex package (v2.0.1) |
oh! I didnt see any parameters in recipe()... didnt think to check prep(). thanks for your help! |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue. |
Hi!
Back in the days, one needed to use recipes::string2factor() to convert strings to factor. Now it is all done without asking.
Is it the expected behaviour?
Here is my sessioninfo() if it is not the expected behaviour:
The text was updated successfully, but these errors were encountered: