Is the “*apply” family really not vectorized?
First of all, in your example you make tests on a “data.frame” which is not fair for colMeans, apply and “[.data.frame” since they have an overhead: system.time(as.matrix(m)) #called by `colMeans` and `apply` # user system elapsed # 1.03 0.00 1.05 system.time(for(i in 1:ncol(m)) m[, i]) #in the `for` loop # user system elapsed # 12.93 … Read more