-1
對不起,我正在遇到一些麻煩,我需要管理的數據。 我有兩個data.frames:匹配兩列不同的數據框架
DF1 Col1 Col2 Col3 Cell_line1 0.11 G1 Cell_line1a 0.2 G1 Cell_line2 0.44 G1 Cell_line2a 0.32 G1 Cell_line3 0.67 G1 Cell_line3a 0.98 G1 Cell_line4 0.55 G1 Cell_line4a 0.5 G1 Cell_line1 0.1 G2 Cell_line1a 0.22 G2 Cell_line2 0.47 G2 Cell_line2a 0.31 G2 Cell_line3 0.65 G2 Cell_line3a 0.92 G2 Cell_line4 0.53 G2 Cell_line4a 0.7 G2 ............................
直到640行。
然後又data.frame,看起來像:
DF1 Col1 Col3 Cell_line1 G1 Cell_line1a G1 Cell_line3 G2 Cell_line3a G2 Cell_line4 G2 Cell_line4a G2
我想下面的輸出:
DF3 Col1 Col2 Col3 Cell_line1 0 G1 Cell_line1a 0 G1 Cell_line2 0.44 G1 Cell_line2a 0.32 G1 Cell_line3 0.67 G1 Cell_line3a 0.98 G1 Cell_line4 0.55 G1 Cell_line4a 0.5 G1 Cell_line1 0.1 G2 Cell_line1a 0.22 G2 Cell_line2 0.47 G2 Cell_line2a 0.31 G2 Cell_line3 0 G2 Cell_line3a 0 G2 Cell_line4 0 G2 Cell_line4a 0 G2 ............................
換句話說,我想匹配DF1的第一列與DF2的第一列以及DF1的第三列與第二列DF2的列,並將DF1 [,2]中的數值替換爲0,其中匹配發生。 任何人都可以幫助我嗎? 最佳
E.
你知道哪些步驟,你應該採取。 (我會按照你說的順序在腳本中完成這些步驟)。你發現了什麼麻煩?你嘗試過什麼,但沒有成功? – Llopis