Description Usage Arguments Examples
Unlike rray_equal()
and rray_not_equal()
, these functions perform a
strict comparison of two arrays, and return a single logical value.
Specifically:
Broadcasting is not performed here, as the shape is part of the comparison.
The underlying type of the values matter, and 1
is treated
as different from 1L
.
Otherwise, attributes are not compared, so dimension names are ignored.
1 2 3 | rray_all_equal(x, y)
rray_any_not_equal(x, y)
|
x, y |
Vectors, matrices, arrays, or rrays. |
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.