R/is.constant.R

Defines functions is.constant

Documented in is.constant

###########################################################################
# is.constant                                                             #
#                                                                         #
# The purpose of the is.constant function is to provide a logical test of #
# whether or not a vector is a constant.                                  #
###########################################################################

is.constant <-  function(x)
     {
     if(missing(x)) stop("The x argument is required.")
     if(!is.vector(x)) x <- as.vector(x)
     uni <- length(unique(x))
     return(uni <= 1)
     }

#End

Try the LaplacesDemon package in your browser

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

LaplacesDemon documentation built on July 9, 2021, 5:07 p.m.