Sunday 15 July 2012

R- merge 3 or more dataframes -


I have read data in 3 separate dataframes from 3 different files. I have tried the merge function, but I do not want to give the desired output. I have my dataframe:

  Somnames Some MOD AID A754 (P), M-691 (O), S6292 (P), S6 9 4 (P), S739 (P)), S740 (P), S 75 9 (P), S762 P) 1 BS 495 (P) 2 Cs 162 (P), Q15 9 (D) 3DS 45 (P), C47 (C), S48 (P) S26 (P) 4E S18 ( P) 5   

df2:

  SomeName name someMOD someID C S162 (P), Q159 (D) 3DS 45 (P), C47 ( C), S 48 (P), S6 (P) 4 FS 182 (P) 6 ES 18 (P) 5 J D Q100 (P) 9A T754 (P), M-691 (O), SL 4 9 4P), S739 (P), S740 (P) 1   

Df3:

  SomName Some MOD AID AT 754 (P), M791 (O) S692 (P), S6 9 (P), S739 (P), S740 (P), S 75 9 (P) 1 BS 4 9 5 (P) 2D 45 (P), C 47 (C), S 48 (P), S 26 (P)) 4 E S 18 ( P) 5 fs 182 (p) 6 l z 182 (p) 8 cs 162 (p), q15 9 (d) 3 I want an output like something which Merged with AID column: Enter image details here  

Any help really is appreciated. Thank you.

Use decrease to merge multiple data frames at once . An annoying thing about Reduce is that this underlying task passes through 2 arguments, so you have to work on it.

  mymerge & lt; Reduce the function (x, y)   ) (mymerge, list (df1, df2, df3)) (x, y, by = c ("someName", "SomeID"), all = 

No comments:

Post a Comment