I decided to write this short post afterÂ wasting some hours to optimize my R code to make median calculation possible forÂ some million of values. Hope it can help someone else. The problem is easy to explain and to solve. Median is a very expensive operation to compute as it implies ordination of values, therefore sometimes may considerably slow down the code running time.

air jordan Factory

My example makes use of a list of matrices, like this:

pippo <- list(matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5))