I'm looking for ways to merge two matrix with differents size by merging those cells of column that have the same value.
For example the next two matrices:
Matrix 1:
a, 1
b, 4
c, 5
Matrix 2:
a, 8
c, 9
After merging by first column:
a, 1, 8
b, 4, NA
c, 5, 9
Thank you!
merge(mat1,mat2,by="V1",all=TRUE)
– thelatemailplyr::join
which mimics an sql call:join(df1, df2, by = "ID")
. – Jens Tierling