I just ran into the same problem, and if I clearly understood the question, I might have solved it using mapply.
10x10, .
set.seed(1)
X <- matrix(runif(100), 10, 10)
set.seed(2)
Y <- matrix(runif(100), 10, 10)
, . -, X Y, data.frame. , data.frame list, - . mapply() , list. .
res.row <- mapply(function(x, y){cor(x, y)}, as.data.frame(t(X)), as.data.frame(t(Y)))
res.row[1]
V1
0.36788
,
cor(X[1,], Y[1,])
[1] 0.36788
t():
res.col <- mapply(function(x, y){cor(x, y)}, as.data.frame(X), as.data.frame(Y))
, , , X Y , (.. ). , , .