if (FALSE) {
# R base operation
min(1:10)
min(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'
min_x <- min(x_i) # LazyTensor object
min_red_x <- min(x_i, "i") # min reduction indexed by 'i'
}
Run the code above in your browser using DataLab