Skip to content

Commit ff9bc0b

Browse files
committed
Nat's recommendations
1 parent 08e6814 commit ff9bc0b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

R/slide.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,10 @@ epi_slide_opt <- function(x, col_names, f, ..., before = NULL, after = NULL, ref
509509
# positions of user-provided `col_names` into string column names. We avoid
510510
# using `names(pos)` directly for robustness and in case we later want to
511511
# allow users to rename fields via tidyselection.
512-
if (typeof(quo_get_expr(enquo(col_names))) == "character") {
513-
pos <- eval_select(all_of(col_names), data = x, allow_rename = FALSE)
514-
} else {
512+
if (class(quo_get_expr(enquo(col_names))) == "call") {
515513
pos <- eval_select(enquo(col_names), data = x, allow_rename = FALSE)
514+
} else {
515+
pos <- eval_select(all_of(col_names), data = x, allow_rename = FALSE)
516516
}
517517
col_names_chr <- names(x)[pos]
518518
# Always rename results to "slide_value_<original column name>".

man-roxygen/opt-slide-params.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
#' [other tidy-select expression][tidyselect::language], or a vector of
44
#' characters (e.g. `c("cases", "deaths")`). Variable names can be used as if
55
#' they were positions in the data frame, so expressions like `x:y` can be
6-
#' used to select a range of variables. If you have the desired column names
7-
#' stored in a vector `vars`, use `col_names = all_of(vars)`.
6+
#' used to select a range of variables.
87
#'
98
#' The tidy-selection renaming interface is not supported, and cannot be used
109
#' to provide output column names; if you want to customize the output column

0 commit comments

Comments
 (0)