Comparison of two functions for creating list of arrays in R. Lambda-function implementation is about 4 times slower than using rep()
function.
> larray1 <- function(nx, B) rep(list(array(data = 0.0, dim = c(nx, 1))), B)
> larray2 <- function(nx, B) lapply(1:B, function(x) x <- array(data = 0.0, dim = c(nx, 1)))
>
> microbenchmark(
+ larray1(1211, 5),
+ larray2(1211, 5)
+ )