conversion of co-expression matrix in to vector using R
1
0
Entering edit mode
7.9 years ago
Neu ▴ 10

Hi, I have obtained a co-expression matrix (size=17740*17740) as below using R.

          gene1        gene2        gene3       
gene1     1.00000000 -0.43360020  0.64476873  
gene2    -0.43360020  1.00000000 -0.19004216  
gene3     0.64476873 -0.19004216 -0.06267813

I want to convert it as below.

gene1 gene1 1
gene1 gene2 -0.43360020
.
.

How can I do this?

Thank You

R • 1.3k views
ADD COMMENT
1
Entering edit mode
7.9 years ago

Use the gather() function in the tidyr package.

ADD COMMENT
0
Entering edit mode

Thank you. I used melt() function of reshape and got the result.

ADD REPLY

Login before adding your answer.

Traffic: 1818 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