How can I compute pairwise correlations between two matrices with the same/different dimensions?
0
0
Entering edit mode
18 months ago

I who am relatively new to R having two datasets 'df1' and 'df2', followings are reproducible datasets, respectively:

df1 = structure(list(CNAcor_DOWN = c(125L, 116L, 139L, 128L, 126L,
132L), CNAcor_UP = c(83L, 92L, 69L, 80L, 82L, 76L)), row.names =
c("AAMDC",  "ABCC3", "ABRA", "ACACA", "ACE", "ACER3"), class =
"data.frame")

df2 = structure(list(CNAcor_DOWN = c(110L, 99L, 122L, 111L, 129L,
120L,  115L, 92L, 120L, 97L, 128L, 113L), CNAcor_UP = c(98L, 109L,
86L,  97L, 79L, 88L, 93L, 116L, 88L, 111L, 80L, 95L)), row.names =
c("AATK",  "ABCG5", "ABHD2", "ACACA", "ACADL", "ACTR8", "ADAM32",
"ADAM8",  "ADCYAP1", "ADPRH", "ADRA1B", "ADSSL1"), class =
"data.frame")


In which,they both are frequency of expression levels of genes whose levels are divided by either of levels: UP or DOWN across the patients in CNA data (df1) and those in MET data (df2).

Now, I'm wanting to compute the Pearson's pairwise correlations among the frequencies of CNVcor_UP, CNVcor_DOWN, METcor_UP, and METcor_DOWN genes, so that the wanted results look like:

Can anyone help me? Any help would be appreciated. Many Thanks in advance.

r correlation Pearson • 321 views
ADD COMMENT

Login before adding your answer.

Traffic: 2249 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6