I have already asked this question but wasn't well presented, so I decided to ask again from scratch.
I have a Large List object in R containing 100 lists of outputs of different models, each output is itself a list containing the statistics for all the parameters of the model. So I have a sublist for the means, one for sd, etc, inside each one of the 100 outputs lists. Each statistics have a vector or matrix for each parameter of the model. What I want is to merge all the 100 lists outputs in one single large list by aggregating them based on their statistics and parameters names.
modeloutputs <- list("model1"=list("simlist"=list("N"=c(1,2,3,4,5,6,7), "sigma"=c(1,2,3,4), "theta"=c(7,8,9)),
"sd" = list("N"=c(6), "sigma"=c(6.5), "theta"=matrix(6:11, nrow = 2, ncol = 3)),
"mean" = list("N"=c(3), "sigma"=c(3.5), "theta"=matrix(6:11, nrow = 2, ncol = 3))),
"model2"=list("simlist"=list("N"=c(8,9,10,11,12,13,14), "sigma"=c(1,2,3,4), "theta"=c(7,8,9)),
"sd" = list("N"=c(7), "sigma"=c(8.5), "theta"=matrix(6:11, nrow = 2, ncol = 3)),
"mean" = list("N"=c(5), "sigma"=c(5.5), "theta"=matrix(6:11, nrow = 2, ncol = 3))),
"model3"=list("simlist"=list("N"=c(15,16,17,18,19,20,21), "sigma"=c(1,2,3,4), "theta"=c(7,8,9)),
"sd" = list("N"=c(8), "sigma"=c(8.5), "theta"=matrix(6:11, nrow = 2, ncol = 3)),
"mean" = list("N"=c(9), "sigma"=c(9.5), "theta"=matrix(6:11, nrow = 2, ncol = 3))))
modeloutputs_wanted <- list("allmodels"=list("simlist"=list("N"=c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21), "sigma"=c(1,2,3,4,1,2,3,4,1,2,3,4), "theta"=c(7,8,9,7,8,9,7,8,9)),
"sd" = list("N"=c(6,7,8), "sigma"=c(6.5,8.5,8.5), "theta"=matrix(6:11, nrow = 2, ncol = 3)),
"mean" = list("N"=c(3,5,9), "sigma"=c(3.5,5.5,9.5), "theta"=matrix(6:11, nrow = 2, ncol = 3))))
theta should have all the matrixes concatenated by row like a rowbind(), I wasn't able to reproduce it correctly in the example.