all_equal: Function to check whether all elements in a numeric vector...

Description Usage Arguments Value Examples

View source: R/helpers.r

Description

Function to check whether all elements in a numeric vector are equal within some tolerance

Usage

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

Arguments

x

numeric vector

tol

tolerance value

Value

logical value

Examples

1
2
3
4
# Returns TRUE
all_equal(c(3, 3, 3))
# Returns FALSE
all_equal(c(3, 3, 2))

sortinghat documentation built on May 30, 2017, 4:52 a.m.