Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upone_of() as a valid selector #85
Comments
|
No problem! > library(recipes)
Loading required package: dplyr
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Attaching package: ‘recipes’
The following object is masked from ‘package:stats’:
step
> 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
Inputs:
role #variables
outcome 1
predictor 15
Training data contained 10 data points and no missing data.
Steps:
Scaling for Nonlinear1, Nonlinear2 [trained]
> |
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!!🙇