Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

one_of() as a valid selector #85

franperezlopez opened this issue Aug 15, 2017 · 2 comments

one_of() as a valid selector #85

franperezlopez opened this issue Aug 15, 2017 · 2 comments


Copy link

could you please add this feature to your backlog? I think I'd be very helpful to select columns via their own names, and not using integer indexes (num_range())

thanks!! 馃檱

topepo added a commit that referenced this issue Aug 16, 2017
Copy link

topepo commented Aug 16, 2017

No problem!

> library(recipes)
Loading required package: dplyr

Attaching package:dplyrThe following objects are masked frompackage:stats:

    filter, lag

The following objects are masked frompackage:base:

    intersect, setdiff, setequal, union

Attaching package:recipesThe following object is masked frompackage:stats:


> library(caret)
Loading required package: lattice
Loading required package: ggplot2
> set.seed(654)
> dat <- twoClassSim(10)
> some_vars <- c("Nonlinear1", "Nonlinear2")
> rec <- recipe(Class ~ ., data = dat) %>%
+   # step_center(num_range(prefix = "TwoFactor", range  = 1:2)) %>%
+   step_scale(one_of(some_vars)) %>%
+   prep %>%
+   print
step 1 scale training 
Data Recipe


      role #variables
   outcome          1
 predictor         15

Training data contained 10 data points and no missing data.


Scaling for Nonlinear1, Nonlinear2 [trained]

@topepo topepo closed this as completed Aug 23, 2017
Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

2 participants