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

are_identical

Are the inputs identical?


Description

Checks if the inputs are identical.

Usage

are_identical(
  x,
  y,
  allow_attributes = FALSE,
  .xname = get_name_in_parent(x),
  .yname = get_name_in_parent(y)
)

are_identical_legacy(..., l = list())

assert_are_identical(
  x,
  y,
  allow_attributes = FALSE,
  severity = getOption("assertive.severity", "stop")
)

assert_all_are_identical_legacy(..., l = list())

assert_any_are_identical_legacy(..., l = list())

Arguments

x

An R object or expression.

y

Another R object or expression.

allow_attributes

If TRUE, The attributes of x and y are allowed to differ.

.xname

Not intended to be used directly.

.yname

Not intended to be used directly.

...

Some R expressions, deprecated.

l

A list of R expressions, deprecated.

severity

How severe should the consequences of the assertion be? Either "stop", "warning", "message", or "none".

Value

are_identical returns TRUE if x and y are identical. The assert_* function throws an error on failure.

The legacy function are_identical_legacy allows an arbitrary number of inputs and returns a symmetric square logical matrix which is TRUE where pairs of inputs are identical. (The new version of the function is easier to work with, and it is recommended that you switch your code to it.)

See Also

Examples

x <- 1:5
are_identical(c(1, -1), cos(c(0, pi)))
assertive.base::dont_stop(assert_are_identical(c(1, 1), cos(c(0, pi))))

assertive.base

A Lightweight Core of the 'assertive' Package

v0.0-9
GPL (>= 3)
Authors
Richard Cotton [aut, cre], Sunkyu Choi [trl], Ivanka Skakun [trl], Gergely Dar<c3><b3>czi [trl], Anton Antonov [trl], Hisham Ben Hamidane [trl], Anja Billing [trl], Aditya Bhagwat [trl], Rasmus B<c3><a5><c3><a5>th [trl], Mine Cetinkaya-Rundel [trl], Aspasia Chatziefthymiou [trl]
Initial release
2021-02-07

We don't support your browser anymore

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