identical_elements: Check if All Elements in a Numeric Vector Are Identical

View source: R/misc_functions.R

identical_elementsR Documentation

Check if All Elements in a Numeric Vector Are Identical

Description

This function checks whether all elements in a numeric vector are equal within a specified tolerance. It returns TRUE if all elements are identical (considering the tolerance), and FALSE otherwise.

Usage

identical_elements(x, tol = .Machine$double.eps^0.5)

Arguments

x

A numeric vector to test.

tol

A numeric tolerance used for the comparison (default: .Machine$double.eps^0.5).

Value

A logical value indicating whether all elements in x are identical.


ChristK/CKutils documentation built on April 11, 2025, 10:11 p.m.