merge in r code example
Example 1: r how to merge data frames
merge(x = df1, y = df2, by = c("Name_tag1", "Name_tag2"), all = TRUE)
Example 2: r merge lists
l1 <- list(a=1, b=2)
l2 <- list(b=3, c=4)
modifyList(l1, l2)
# > list(a=1, b=3, c=4)
modifyList(l2, l1)
# > list(a=1, b=2, c=4)
# Note: later arguments override elements of the previous arguemnts.