Rfast (version 1.7.3)

Row-wise minimum and maximum: Row-wise minimum and maximum of a matrix.

Description

Row-wise minimum and maximum of a matrix.

Usage

rowMins(x, value = FALSE) rowMaxs(x, value = FALSE)

Arguments

x
A numerical matrix with data.
value
If the value is TRUE it returns the indices of the minimum/maximum, otherwise it returns the minimum and maximum values.

Value

A vector with the relevant values.

See Also

colMins, colMaxs, nth, rowrange colMedians, colVars, sort_mat

Examples

Run this code
x <- matrix( rnorm(1000 * 2000), ncol = 2000 )

system.time( s1 <- rowMins(x) )
system.time( s1 <- apply(x, 1, min) )

system.time( s1 <- rowMaxs(x) )
system.time( s1 <- apply(x, 1, max) )

Run the code above in your browser using DataCamp Workspace