Rfast (version 1.7.3)

Column-wise minimum and maximum : Column-wise minimum and maximum of a matrix

Description

Column-wise minimum and maximum of a matrix in parallel.

Usage

colMins(x, value = FALSE)
colMaxs(x, value = FALSE)
col_Mins_Maxs(x)

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

rowMins, rowMaxs, nth, colrange, colMedians, colVars, sort_mat

Examples

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

system.time( s1 <- colMins(x) )
system.time( s2 <- apply(x, 2, min) )

system.time( s1 <- colMaxs(x) )
system.time( s2 <- apply(x, 2, max) )

system.time( s1 <- col_Mins_Maxs(x) )
system.time( s2 <- c(apply(x, 2, min), apply(x, 2, max)) )

Run the code above in your browser using DataCamp Workspace