R/equal.R

Defines functions rray_not_equal rray_equal

Documented in rray_equal rray_not_equal

#' Equality
#'
#' @description
#' - `rray_equal()` tests whether `x` is equal to `y`.
#'
#' - `rray_not_equal()` tests whether `x` is not equal to `y`.
#'
#' @details
#' The arrays are broadcast to common dimensions before they are compared.
#'
#' @param x An array.
#'
#' @param y An array.
#'
#' @returns
#' A logical array with the common dimensions of `x` and `y`, and no names.
#'
#' @name rray-equal
#' @examples
#' x <- array(1:2, c(2L, 1L))
#'
#' rray_equal(x, 1L)
#' rray_not_equal(x, array(c(1L, 3L), c(1L, 2L)))
NULL

#' @rdname rray-equal
#' @export
rray_equal <- function(x, y) {
  .Call(ffi_rray_equal, x, y, environment())
}

#' @rdname rray-equal
#' @export
rray_not_equal <- function(x, y) {
  .Call(ffi_rray_not_equal, x, y, environment())
}

Try the rray package in your browser

Any scripts or data that you put into this service are public.

rray documentation built on Nov. 17, 2026, 5:07 p.m.