Similar questions have been raised for all combinations of objects within lists (see here or here), but this particular problem has yet not been asked:
I have two lists that contain the same (high) number of data frames, with the same name, size and ordering, though different values, see this sample data set:
A <- data.frame(matrix(rnorm(30), nrow=5, ncol=6))
B <- data.frame(matrix(rnorm(20), nrow=5, ncol=4))
list1 <- list(A,B)
A <- data.frame(matrix(rnorm(30), nrow=5, ncol=6))
B <- data.frame(matrix(rnorm(20), nrow=5, ncol=4))
list2 <- list(A,B)
I would now like to multiply data frames with the same name element wise and store the result in a new list, such that:
list3:
A*A B*B
Any advice would be much appreciated!