What package would be best to systematically understand the correlation of variables in two matrix, such as v1, v2, ...vn in matrix 1, vb1, vb2,...vbn in matrix2? I would like to know which variable in matrix 1 has the most correlation in a variable in matrix 2. CCA seemed perform the similar job, but the output plot was not what I expected. Any suggestions would be appreciated.
Presuming you have numerical variables only, you could try:
library(Hmisc)
#as example
matrixA <- as.matrix(mtcars[1:3])
matrixB <- as.matrix(mtcars[4:6])
rcorr(matrixA,matrixB)
This for example computes a matrix of Pearson's r or Spearman's rho rank correlation coefficients.
Since you mentioned plotting, you might want to try out correlation matrix plot from the psych package - this however demands to unite your data into one matrix first: