When we are dealing with large datasets and there is a need to calculate some values like the
row/column min/max/rank/mean
etc we should avoid theapply
function because it takes a lot of time. Instead, we can use the matrixStats package and its corresponding functions. Let’s provide some comparisons.
Click through for a demonstration of how much slower it can be in certain cases. H/T R-Bloggers.