Skip to content

Commit

Permalink
Merge pull request #582 from cmu-delphi/lcb/fix-slide-opt-validation
Browse files Browse the repository at this point in the history
Improve `epi_slide_{sum,mean}` unsupported-arg messages.
  • Loading branch information
brookslogan authored Dec 10, 2024
2 parents 101aad8 + 5da97c7 commit e5ec121
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions R/slide.R
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,9 @@ epi_slide_mean <- function(
}
if ("new_col_name" %in% provided_args || ".new_col_name" %in% provided_args) {
cli::cli_abort(
"epi_slide_mean: the argument `new_col_name` is not supported. If you want to customize
the output column names, use `dplyr::rename` after the slide."
"epi_slide_opt: the argument `new_col_name` is not supported for `epi_slide_opt`. If you want to customize
the output column names, use `.prefix =`, `.suffix =`, or `.new_col_**names** =`.",
class = "epiprocess__epi_slide_opt__new_name_not_supported"
)
}
if ("names_sep" %in% provided_args || ".names_sep" %in% provided_args) {
Expand Down Expand Up @@ -1069,8 +1070,9 @@ epi_slide_sum <- function(
}
if ("new_col_name" %in% provided_args || ".new_col_name" %in% provided_args) {
cli::cli_abort(
"epi_slide_sum: the argument `new_col_name` is not supported. If you want to customize
the output column names, use `dplyr::rename` after the slide."
"epi_slide_opt: the argument `new_col_name` is not supported for `epi_slide_opt`. If you want to customize
the output column names, use `.prefix =`, `.suffix =`, or `.new_col_**names** =`.",
class = "epiprocess__epi_slide_opt__new_name_not_supported"
)
}
if ("names_sep" %in% provided_args || ".names_sep" %in% provided_args) {
Expand Down
5 changes: 3 additions & 2 deletions man/epiprocess-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e5ec121

Please sign in to comment.