Performs logical OR along the specified axes.
Usage
prim_any(x, axes, drop = TRUE)
Arguments
- x
(arrayish)
One input. Must be a boolean or an R logical.
- axes
(integer())
Axes to reduce over. Negative values count from the end, i.e. -1 refers
to the last axis.
- drop
(logical(1))
Whether to drop the reduced axes: removed from the output shape if TRUE,
set to 1 if FALSE.
Value
(arrayish)
Has the boolean data type. The shape is the input's with the reduced axes
removed (drop = TRUE) or set to 1 (drop = FALSE).
Examples
x <- nv_matrix(c(TRUE, FALSE, TRUE, TRUE), nrow = 2)
# TRUE where any element is TRUE along axis 1
prim_any(x, axes = 1L)
#> AnvlArray
#> 1
#> 1
#> [ CPUbool{2} ]
# drop = FALSE keeps the reduced axis at size 1 instead
prim_any(x, axes = 1L, drop = FALSE)
#> AnvlArray
#> 1 1
#> [ CPUbool{1,2} ]