Skip to content

Commit

Permalink
moved check operators to mlr3misc
Browse files Browse the repository at this point in the history
  • Loading branch information
advieser committed Dec 9, 2024
1 parent 2ad18de commit b331dbb
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,6 @@ curry = function(fn, ..., varname = "x") {
}
}

# 'and' operator for checkmate check_*-functions
# example:
# check_numeric(x) %check&&% check_true(all(x < 0))
`%check&&%` = function(lhs, rhs) {
if (!isTRUE(lhs) && !isTRUE(rhs)) return(paste0(lhs, ", and ", rhs))
if (isTRUE(lhs)) rhs else lhs
}
# check_numeric(x) %check||% check_character(x)
`%check||%` = function(lhs, rhs) {
if (!isTRUE(lhs) && !isTRUE(rhs)) return(paste0(lhs, ", or ", rhs))
TRUE
}

# perform gsub on names of list
# `...` are given to `gsub()`
rename_list = function(x, ...) {
Expand Down

0 comments on commit b331dbb

Please sign in to comment.