Closed pschil closed 3 years ago
We are using mapply()
in various places to loop over the elements of two lists and expect a list to be returned. However, because the default SIMPLIFY=TRUE
was not set to FALSE, mapply()
may return an array instead of a list, if dimensions allow.
Example:
l.Q <- mapply(l.Z2, l.W, FUN = function(g.z2, g.w){
g.w %*% g.z2 %*% corpcor::pseudoinverse(Matrix::crossprod(g.z2, g.w) %*% g.w %*% g.z2) %*%
Matrix::crossprod(g.z2, g.w)
})
l.Z2
and l.W
are lists of matrices, and l.Q
is expected to be a list of matrices as well but may be a single array in some cases.
Fix: Pass SIMPLIFY=FALSE
to every call of mapply()
.
Discussed in https://github.com/mmeierer/REndo/discussions/62