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