R合并表格

>library(dplyr)
>info = read.csv("test.csv", header = T)
> head(info)
               cell                 type
1 w11_1:CELL2755_N1 EX_migrating_newborn
2 w11_1:CELL2197_N1  EX_unknown4_TAS2R14

>cnv=read.table("w11_1_2_copykat_prediction.txt",header = T)
>a <- merge(info, cnv, by.x='cell', by.y='cell.names')
> head(a)
                cell          type copykat.pred
1     w11_3:CELL1_N4           EX1    aneuploid
2 w11_3:CELL10000_N2    cycling_IN    aneuploid

>write.table(a, file = "a.txt", sep = "\t", quote = F, row.names = F)

你可能感兴趣的:(R合并表格)