-1

I have spent couple of days in searching and trying multiple codes. I have used Merge (dataset, dataset1, method = "combat") I am first time using this forum and I am also new in R. I am working on gene expression datasets. Overall, I have 31 data sets, out of which 22 are training datasets and 9 are testing datasets.I want to merge all training datasets in one dataset and all testing datasets in one dataset.Also want to remove batch effect. I have used "merge" and "rbind" functions.I have used following code:

       eset1 = read.csv("GSE2603.csv",header=T)
       eset2 = read.csv("GSE5460.csv",header=T)
       esets_Combat=merge(eset1,eset2,method='COMBAT')
       write.csv(esets_Combat, file = "MyData.csv",row.names=TRUE)

Data set example:

                        GSM50036    GSM50037    GSM50038
                Labels    0             0          0
             1007_s_at  10.87493636 9.974109876 10.73323948
             1053_at    6.230819524 6.72729023  6.349621731
              117_at    7.008770037 7.317361071 6.849455739
              121_at    8.504376889 8.293417668 8.495880914

Can anyone help me please.

Mahrukh
  • 11
  • 1
  • 2
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Show what you tried and how exactly it didn't work. – MrFlick Mar 30 '18 at 19:24
  • package `dplyr` has function `bind_rows` which is more tolerant of data problems than rbind. – Andrew Lavers Mar 30 '18 at 19:36

1 Answers1

1

Try: dplyr::bind_rows(dataset1, dataset2) It appends dataset2 to dataset1 as new rows.

BiSarfraz
  • 459
  • 1
  • 3
  • 14