rray_maximum() and rray_minimum() compute the elementwise max / min between x and y.

rray_maximum(x, y)

rray_minimum(x, y)

Arguments

x, y

A vector, matrix, array or rray.

Value

The elementwise max/min of x and y, with broadcasting.

Examples

# Elementwise maximum rray_maximum(c(1, 2, 3), c(3, 2, 1))
#> [1] 3 2 3
# Elementwise minimum rray_minimum(c(1, 2, 3), c(3, 2, 1))
#> [1] 1 2 1
# With broadcasting x <- matrix(1:3) rray_maximum(x, t(x))
#> [,1] [,2] [,3] #> [1,] 1 2 3 #> [2,] 2 2 3 #> [3,] 3 3 3