R/allNumericsTheSame.R

Defines functions allNumericsTheSame

Documented in allNumericsTheSame

#' Are all numerics the same?
#' 
#' Test whether all numerics in a vector are the same.
#' @param x A numeric vector
#' @export

allNumericsTheSame = function(x){
  ## x is a numeric vector
  # not dealing with vectors having NAs
  stopifnot(!any(is.na(x))) 
  if(max(x) - min(x) == 0){
    return(T)
  }
  else {
    return(F)
  }
}
msxakk89/dat documentation built on Aug. 3, 2020, 6:39 p.m.