same: Are the values in each object the same?

View source: R/utils_conditionals.R

sameR Documentation

Are the values in each object the same?

Description

The primary difference from identical & all.equal is that objects are sorted by name so order doesn't matter. Set sort_by_names = FALSE to sort by values.

Usage

same(
  target = x,
  current = y,
  sort_by_names = TRUE,
  x = target,
  y = current,
  ...
)

Arguments

target

R object.

current

other R object, to be compared with target.

x

obj

y

obj

...

Arguments passed on to base::all.equal

Value

lgl

See Also

Other conditionals: is_error(), is_legit(), is_project(), larger(), most(), zchar()

Examples

same(list(x = 1, y = 2), list(y = 2, x = 1))

yogat3ch/UU documentation built on May 31, 2024, 10:14 p.m.