[R] <no subject>
sdavis2 at mail.nih.gov
Thu Apr 22 15:37:16 CEST 2004
I want to compute pairwise correlations between all rows of two matrices
where the pairs are formed by taking all rows from each matrix with a common
factor. In other words, I want to take all pairwise correlations between
rows after stratifying by a factor (the same factor) in each matrix. More
concretely, I have factor for matrix 1 like:
And for matrix 2,
And two matrices with the same number of columns. I want to get
correlations between row 1 of matrix 1 and row 1 of matrix 2, row 2 of
matrix 2 and row 1 of matrix 2, etc.
I just can't seem to get the correct combination of "apply" functions to do
this. Any ideas?
More information about the R-help