File: base-comparison.r

package info (click to toggle)
r-cran-assertthat 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 220 kB
  • sloc: sh: 9; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#' @include base.r
NULL

logical_is_not <- function(failed) {
  function(call, env) {
    lhs <- paste(deparse(call[[2]]), collapse = "")
    rhs <- paste(deparse(call[[3]]), collapse = "")
    paste0(lhs, " not ", failed, " ", rhs)
  }
}

base_fs$"==" <- logical_is_not("equal to")
base_fs$"<" <-  logical_is_not("less than")
base_fs$">" <-  logical_is_not("greater than")
base_fs$">=" <- logical_is_not("greater than or equal to")
base_fs$"<=" <- logical_is_not("less than or equal to")
base_fs$"!=" <- logical_is_not("not equal to")