I have read Multiplying Combinations of a list of lists in R. But i can't still apply it on my case.
I have two different lists in R:
x <- list(matrix(1:4,nrow=2), matrix(5:8, nrow=2))
y <- list(matrix(c(1,0,0,1), nrow=2), matrix(c(0,1,0,1), nrow=2) )
I want to multiply the 1st element of x
with the 1st element of y
;
the 2nd element of x
with the 2nd element of y
. That is,
x[[1]] * y[[1]]
x[[2]] * y[[2]]
But I don't want to write one line code for each element since I have 100 elements in each list.