R/is_constant.R

Defines functions is_constant

Documented in is_constant

#' @rdname tests
#' @export

is_constant <- function( x, na.rm=TRUE ) {
  
  if( all( is.na(x) ) ) return(NA)
  
  if( na.rm )
    x <- na.omit(x)
  
  all( x == x[1] )
  
}
decisionpatterns/ordering documentation built on May 5, 2019, 7:09 a.m.