Use Reduce if you need element multiplication
> Lists <- list(matrix(1:4, 2), matrix(5:8, 2), matrix(10:13, 2)) > Reduce("*", Lists) [,1] [,2] [1,] 50 252 [2,] 132 416
Instead of using abind you can use the function simplify2array and apply
> apply(simplify2array(Lists), c(1,2), prod) [,1] [,2] [1,] 50 252 [2,] 132 416
If you want to use abind , use the following:
> library(abind) > apply(abind(Lists, along=3), c(1,2), prod) [,1] [,2] [1,] 50 252 [2,] 132 416
Jilber urbina
source share