Skip to content

Commit ac12ec1

Browse files
committed
refactor(epi_slide_opt): simplify tidyselect
1 parent 2ef8914 commit ac12ec1

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

NAMESPACE

-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ importFrom(rlang,"%||%")
189189
importFrom(rlang,.data)
190190
importFrom(rlang,.env)
191191
importFrom(rlang,arg_match)
192-
importFrom(rlang,as_label)
193192
importFrom(rlang,caller_arg)
194193
importFrom(rlang,caller_env)
195194
importFrom(rlang,check_dots_empty)
@@ -207,7 +206,6 @@ importFrom(rlang,is_quosure)
207206
importFrom(rlang,list2)
208207
importFrom(rlang,missing_arg)
209208
importFrom(rlang,new_function)
210-
importFrom(rlang,quo_get_expr)
211209
importFrom(rlang,quo_is_missing)
212210
importFrom(rlang,sym)
213211
importFrom(rlang,syms)

R/slide.R

+2-6
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ get_before_after_from_window <- function(window_size, align, time_type) {
564564
#' functions).
565565
#'
566566
#' @importFrom dplyr bind_rows mutate %>% arrange tibble select all_of
567-
#' @importFrom rlang enquo quo_get_expr as_label expr_label caller_arg
567+
#' @importFrom rlang enquo expr_label caller_arg
568568
#' @importFrom tidyselect eval_select
569569
#' @importFrom purrr map map_lgl
570570
#' @importFrom data.table frollmean frollsum frollapply
@@ -714,11 +714,7 @@ epi_slide_opt <- function(
714714
# positions of user-provided `col_names` into string column names. We avoid
715715
# using `names(pos)` directly for robustness and in case we later want to
716716
# allow users to rename fields via tidyselection.
717-
if (inherits(quo_get_expr(enquo(.col_names)), "character")) {
718-
pos <- eval_select(dplyr::all_of(.col_names), data = .x, allow_rename = FALSE)
719-
} else {
720-
pos <- eval_select(enquo(.col_names), data = .x, allow_rename = FALSE)
721-
}
717+
pos <- eval_select(enquo(.col_names), data = .x, allow_rename = FALSE)
722718
col_names_chr <- names(.x)[pos]
723719
# Always rename results to "slide_value_<original column name>".
724720
result_col_names <- paste0("slide_value_", col_names_chr)

0 commit comments

Comments
 (0)