This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merging of datasets from same tissue/region

Hi,

I have six data sets from different platforms, I annotated probs in each data to gene symbole. I want to merge them like so I have six data sets with the same gene symbols in rows. I used intertection but data sets returned NA. how to match these data?

I thought about merging one by one

merge(data1,data2,by="first col.name")

then extracting each data from merged one but that returned a data without genes in rows

when I tried to merge all

> merge=merge(data1,data2,data3,data4,data5,data6,by="ID")
Error in fix.by(by.x, x) : 
  'by' must specify one or more columns as numbers, names or logical

but all have ID in first col.name

I should merged one by one but

merged=merge(data1,data2,by="first col.name")

data1=merged[,1:43]

data2=merged[1,44:150]  gives just one observation
.

.
r

thank you,

I can exteact DF1 from DF by DF1=DF[,1:42] but for extracting DF2 ----> DF2=DF[1,43:150] gives only one observation and DF2=DF[,43:150] gives no genes in rows. how extract DF2 which contains row names also?

I don't understand what kind of structure do want to process and obtain. I mean, it seems like your DF is already merged so why sub-setting DF1 with the first 42 columns and DF2 with other columns but a single line?

because I need each of DF1 and DF1 independently

1 answer

DF2 <- DF[ , c(1, 43:150)]

Log in to answer this question.