Skip to contents

Maximum operation for vector/matrix/array or LazyTensor, or maximum reduction for LazyTensor.

Usage

max(x, ...)

Arguments

x

input for max.default() or max.LazyTensor().

...

optional arguments for max.default() or max.LazyTensor().

Value

Maximum of input.

Details

If x is a LazyTensor, see max.LazyTensor(), else see max.default().

Author

Chloe Serre-Combe, Amelie Vernay

Examples

if (FALSE) {
# R base operation
max(1:10)
max(c(NA, 1, 2), na.rm = TRUE)
# LazyTensor operation
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # creating LazyTensor from matrix x, 
                                    # indexed by 'i'

max_x <- max(x_i)                   # LazyTensor object
max_red_x <- max(x_i, "i")          # max reduction indexed by 'i'
}