Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.constant

Logical Check of a Constant


Description

This function provides a logical test of whether or not a vector is a constant.

Usage

is.constant(x)

Arguments

x

This is a vector.

Details

As opposed to a variable, a constant is a vector in which the elements contain less than or equal to one unique value.

Value

The is.constant function returns a logical result, reporting TRUE when a vector is a constant, or FALSE otherwise.

Author(s)

See Also

Examples

library(LaplacesDemon)
is.constant(rep(1,10)) #TRUE
is.constant(1:10) #FALSE

LaplacesDemon

Complete Environment for Bayesian Inference

v16.1.4
MIT + file LICENSE
Authors
Byron Hall [aut], Martina Hall [aut], Statisticat, LLC [aut], Eric Brown [ctb], Richard Hermanson [ctb], Emmanuel Charpentier [ctb], Daniel Heck [ctb], Stephane Laurent [ctb], Quentin F. Gronau [ctb], Henrik Singmann [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.