x <- matrix( rnorm(1000 * 2000), ncol = 2000 )
system.time( colMins(x) )
system.time( apply(x, 2, min) )
s1 = colMins(x)
s2 = apply(x, 2, min)
system.time( colMaxs(x) )
system.time( apply(x, 2, max) )
s1 = colMaxs(x)
s2 = apply(x, 2, max)
system.time( colMins_parallel(x, ncores = 2) )
system.time( apply(x, 2, min) )
s1 = colMins_parallel(x, ncores = 2)
s2 = apply(x, 2, min)
Run the code above in your browser using DataLab