Skip to content

Commit

Permalink
formula to function in order to avoid .
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelru committed Feb 15, 2024
1 parent 48483e7 commit b2cacdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions R/validate_inputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
#' # set up input validation
#' iv <- InputValidator$new()
#' iv$add_rule("letter", sv_in_set(LETTERS, "choose a capital letter"))
#' iv$add_rule("number", ~ if (as.integer(.data$.) %% 2L == 1L) "choose an even number")
#' iv$add_rule("number", function(x) if (as.integer(x) %% 2L == 1L) "choose an even number")
#' iv$enable()
#' # more input validation
#' iv_par <- InputValidator$new()
#' iv_par$add_rule("color", sv_required(message = "choose a color"))
#' iv_par$add_rule("color", ~ if (length(.data$.) > 1L) "choose only one color")
#' iv_par$add_rule("color", function(x) if (length(x) > 1L) "choose only one color")
#' iv_par$add_rule(
#' "size",
#' sv_between(
Expand All @@ -87,7 +87,7 @@
#' ))
#' )
#'
#' plot(.data$eruptions ~ .data$waiting, faithful,
#' plot(faithful$eruptions ~ faithful$waiting,
#' las = 1, pch = 16,
#' col = input[["color"]], cex = input[["size"]]
#' )
Expand Down
6 changes: 3 additions & 3 deletions man/validate_inputs.Rd

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

0 comments on commit b2cacdc

Please sign in to comment.