Reduce

Published by onesixx on

https://stackoverflow.com/questions/26220730/how-to-merge-a-list-of-dataframes-by-a-single-column

https://stat.ethz.ch/pipermail/r-help/2012-January/301984.html
R
$df1
  Name Sample1
1    A       1
2    B       2
3    C       3

$df2
  Name Sample2
1    A       4
2    B       5
3    C       6

$df3
  Name Sample3
1    A       7
2    B       8
3    C       9
R
  Name Sample1 Sample2 Sample3
1    A       1       4       7
2    B       2       5       8
3    C       3       6       9

Multi-vector

https://www.r-bloggers.com/intersect-for-multiple-vectors-in-r/

Reduce(intersect, list(a,b,c))

Reduce(union, list(x, y, z))

reduce()
combine from the left

R
R



Categories: Reshaping

onesixx

Blog Owner

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x