all_same: All Values Same

View source: R/all_same.R

all_sameR 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 all.equal(), for such a purpose combined with isTRUE().

Usage

all_same(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

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

stufield/stuRpkg documentation built on April 2, 2022, 2:05 p.m.