powered by
Finds either row or column maximum values of a matrix.
matMaxs(x, dim = 1)
numeric matrix.
=1, for row maximum values; =2, for column maximum values.
=1
=2
Returns a numeric vector with row or column maximum values.
The function is very much the same as using apply(x, 1, max) or apply(x, 2, max), but faster.
apply(x, 1, max)
apply(x, 2, max)
Matrix x may contain Inf or -Inf, but not NA or NaN.
x
Inf
-Inf
NA
NaN
# NOT RUN { x = cbind(c(1:4,Inf), 5:1) matMaxs(x) matMaxs(x, 2) # }
Run the code above in your browser using DataLab