rray_all_equal: Strictly compare arrays

Description Usage Arguments Examples

View source: R/compare.R

Description

Unlike rray_equal() and rray_not_equal(), these functions perform a strict comparison of two arrays, and return a single logical value. Specifically:

Usage

1
2
3

Arguments

x, y

Vectors, matrices, arrays, or rrays.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# This is definitely true!
rray_all_equal(1, 1)

# Different types!
rray_all_equal(1, 1L)

# Different types!
rray_all_equal(rray(1), matrix(1))

# Different shapes!
rray_all_equal(matrix(1), matrix(1, nrow = 2))

# Are any values different?
rray_any_not_equal(c(1, 1), c(1, 2))

# Is the shape different?
rray_any_not_equal(1, c(1, 2))

# Dimension names don't matter
x <- matrix(1, dimnames = list("foo", "bar"))
rray_all_equal(x, matrix(1))

rray documentation built on July 23, 2019, 5:04 p.m.