Skip to content

Commit

Permalink
Pass .data directly to eval_rename()
Browse files Browse the repository at this point in the history
  • Loading branch information
markfairbanks committed Oct 14, 2022
1 parent 6d29fb3 commit 4e523de
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions R/step-call.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ tail.dtplyr_step <- function(x, n = 6L, ...) {
#' dt %>% rename(new_x = x, new_y = y)
#' dt %>% rename_with(toupper)
rename.dtplyr_step <- function(.data, ...) {
sim_data <- simulate_vars(.data)
locs <- tidyselect::eval_rename(expr(c(...)), sim_data)
locs <- tidyselect::eval_rename(expr(c(...)), .data)

step_setnames(.data, .data$vars[locs], names(locs), in_place = TRUE, rename_groups = TRUE)
}
Expand Down

0 comments on commit 4e523de

Please sign in to comment.