Here is a data.table answer with a similar approach, like @akrun's answer.
However, instead of renaming the columns, we will set them as keys. Then we can unite by keys, not by name. This saves the column names.
library(data.table) funky <- function(x) { setDT(my.list[[x]]) setkeyv(my.list[[x]], ids[x]) return(NULL) }
Thus, the index x will be passed to this function. First, it will set data.frame at xth my.list to data.table . He will then set the key of this new data.table based on the name of the column specified at the same position in ids . Finally, since this is all done in place, return NULL to prevent useless printing.
Now apply this function to all objects in the list.
a <- lapply(seq_along(ids), funky) Reduce(function(x, y) merge(x, y, by.x = key(x), by.y = key(y), all = TRUE), my.list)
Unpacking Reduce , we can specify the columns to combine using key(x) and key(y) . This is a step that allows us to avoid changing column names.
# abcdemo
source share