【发布时间】:2015-04-21 14:44:07
【问题描述】:
如何通过基因名称比较两个数据集df1和df2,并从df2中提取每个基因名称的对应值并将其插入df1
df1 <-
Genes sample.ID chrom loc.start loc.end num.mark
Klri2 LO.WGS 1 3010000 173490000 8430
Rrs1 LO.WGS 1 3010000 173490000 8430
Serpin LO.WGS 1 3010000 173490000 8430
Myoc LO.WGS 1 3010000 173490000 8430
St18 LO.WGS 1 3010000 173490000 8430
df2 <-
RL pValue. chr start end CNA Genes
2 2.594433 1 129740006 129780779 gain Klri2
2 3.941399 1 130080653 130380997 gain Serpin,St18,Myoc
df3<-
Genes sample.ID chrom loc.start loc.end num.mark RL pValue CNA
Klri2 LO.WGS 1 3010000 173490000 8430 2 2.594433 gain
Rrs1 LO.WGS 1 3010000 173490000 8430 0 0 0
Serpin LO.WGS 1 3010000 173490000 8430 2 3.941399 gain
Myoc LO.WGS 1 3010000 173490000 8430 2 3.941399 gain
St18 LO.WGS 1 3010000 173490000 8430 2 3.941399 gain
【问题讨论】:
-
这里是 dplyr 的精彩介绍。这是一个用于合并和选择 R 中特定列的包。它非常有用,值得一读。比这个具体问题更有价值。 link 如果仍然没有帮助,请回来询问具体问题,参考您的尝试和结果。
标签: r