allSame: All Values Same

View source: R/allSame.R

allSameR Documentation

All Values Same

Description

Returns a logical as to whether all values within a vector are identical. This function does NOT compare two independent vectors. Please use link{all.equal}, for such a purpose combined with isTRUE.

Usage

allSame(x)

Arguments

x

A vector of values. Can be one of the following objects classes: numeric, character, factor, or logical.

Value

Logical. TRUE or FALSE.

Author(s)

Stu Field

See Also

isTRUE, all.equal

Examples

allSame(1:4)
allSame(rep(5, 10))
allSame(rep("A", 10))
allSame(letters)
allSame(c(TRUE, TRUE, TRUE))
allSame(c(TRUE, TRUE, FALSE))

stufield/TestPkg documentation built on Jan. 26, 2023, 10:48 p.m.