R/validation.R

Defines functions is.not.positive.integer

#------------------------
# check if an input is a positive integer
is.not.positive.integer <- function(x){
  if (length(x) != 1 || is.na(x) || !is.numeric(x) || x <= 0 || x %% 1 != 0){
    res <- TRUE
  } else {
    res <- FALSE
  }
  return(res)
}
Karpefors/Tendril documentation built on June 12, 2022, 9:22 p.m.