Quantcast
Channel: Merging two data frames in r - error - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Merging two data frames in r - error

$
0
0

I have two datasets one is log10 transformed and the other is RMA normalized.

DATAFRAME 1(protdata)

 dim(protdata) [1] 437   7      Locus      COBL9   WER    CORTEX   SCR     WOL    PET111  1  AT1G01090  4.3035  4.3975  4.4620  4.3879  4.2620  4.2045  2  AT1G02780  4.7852  4.6865  4.7801  5.0038  4.9457  4.9515  3  AT1G04040  4.5854  4.1787  3.4836  3.4918  4.2366  3.5197  4  AT1G04270  4.3578  4.4281  4.3348  4.5680  4.4208  4.4056  5  AT1G04410  4.9808  4.9913  5.2186  5.3315  5.2178  5.4524  6  AT1G04430  4.2382  4.3564  4.3535  4.3056  4.0263  3.9485  7  AT1G04480  4.5462  4.4302  4.4987  4.8039  4.5807  4.4876

DATAFRAME 2 (transdata)

 dim(transdata) [1] 22810    77       Locus      probes     COBL9    WER   CORTEX  SCR      1   AT1G01090   244901_at   4.7852 4.6865  4.7801  5.0038   2   AT1G02780   244902_at   4.5854 4.1787  3.4836 3.4918                           3   AT1G04040   244903_at   4.3578 4.4281  4.3348  4.5680               4   AT1G04570   244904_at   4.9808 4.9913  5.2186  5.3315                   5   AT1G04610   244905_at   4.2382 4.3564  4.3535  4.3056                   6   AT1G02430   244906_at   4.5462 4.4302  4.4987  4.8039  

I want to merge the two dataframes based on the Locus ids and used

 matchin<-merge(transdata,protdata,by.x="Locus",by.y="Locus")

But I get a different dataframe which is as follows: In the above example I have two matching ids in both frames but result is :

      Locus      probes     COBL9    WER    CORTEX  SCR      1   AT1G01090   244901_at  14.7852 12.6865 13.7801 12.0038      2   AT1G02780   244902_at  14.5854 13.1787 12.4836 13.4918              COBL9   WER    CORTEX   SCR     WOL    PET111            4.3035  4.3975  4.4620  4.3879  4.2620  4.2045            4.7852  4.6865  4.7801  5.0038  4.9457  4.9515

Though it is a dataframe containing unique locus ids the intensity values from the transdata alone has changed.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images