R/is_constant.R

#' @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] )
  
}

Try the ordering package in your browser

Any scripts or data that you put into this service are public.

ordering documentation built on May 1, 2019, 9:16 p.m.