How Can I fusionate 2 tables in R? So I can Count data.
1
0
Entering edit mode
9.9 years ago
tiago211287 ★ 1.5k

I have this 2 lists, and I wanna fusionate the 2 table based in the Gene ID's. Then I can count how many ups and Downs per chromossome and band. SOme R expert can help me?

File1.txt

Group1    Band    Chromosome Name    Group2    Band    Chromosome Name    Group3   Band    Chromosome Name
ENSMUSG00000004707    H3    1    ENSMUSG00000005763    H2.3    1     ENSMUSG00000098895    H2.1   1
ENSMUSG00000006403    H3    2    ENSMUSG00000008136    B    2    ENSMUSG00000046814    E4    2
ENSMUSG00000008475    G3    3    ENSMUSG00000025917    A2    3    ENSMUSG00000004707    H3    3
ENSMUSG00000009772    E4    4    ENSMUSG00000025938    A3    4    ENSMUSG00000004552    H3    4

File2.txt

Group1    Expression    Group2    Expression    Group3   Expression
ENSMUSG00000004707    Up    ENSMUSG00000025938    Up    ENSMUSG00000004552    Up
ENSMUSG00000006403   Up     ENSMUSG00000025917    Up    ENSMUSG00000004707    Up
ENSMUSG00000008475    Down    ENSMUSG00000005763    Down    ENSMUSG00000046814    Down
ENSMUSG00000009772    Down    ENSMUSG00000008136    Down    ENSMUSG00000098895    Down
Ensembl rna-seq R • 1.7k views
ADD COMMENT
1
Entering edit mode

See ?merge in R.

ADD REPLY
1
Entering edit mode
9.9 years ago
tiago211287 ★ 1.5k

I Found a solution myself. here is what I did:

library(reshape2)
library(plyr)
table1 <- read.delim('genescol.txt',header=T)
table2 <- read.delim('genescol2.txt',header=T)
res <- merge(table1,table2,by.x='Group1',by.y="Group1")
res.count2 <- count(res,vars = c("Band","Chromosome.Name","Expression"))
ADD COMMENT

Login before adding your answer.

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