File: assertions.R

package info (click to toggle)
r-cran-filelock 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 184 kB
  • sloc: ansic: 470; sh: 13; makefile: 2
file content (12 lines) | stat: -rw-r--r-- 242 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12

is_string <- function(x) {
  is.character(x) && length(x) == 1 && !is.na(x)
}

is_flag <- function(x) {
  is.logical(x) && length(x) == 1 && !is.na(x)
}

is_timeout <- function(x) {
  is.numeric(x) && length(x) == 1 && !is.na(x) && x >= 0
}