I have a list of dataframes that I want to put columns together. To illustrate here's a dummy set:
Data1 <- data.frame(A = c(1, 2, 3, 4, 5),
B = c(2, 3, 5, 3, 10))
Data2 <- data.frame(A = c(1, 2, 3, 4, 6),
C = c(3, 4, 8, 12, 2))
Data3 <- data.frame(A = c(1, 2, 3, 4, 6),
D = c(4, 3, 1, 9, 2))
list <- list(Data1, Data2, Data3)
I want the output to look like this:
A B C D
1 2 3 4
2 3 4 3
3 5 8 1
4 3 12 9
5 10 NA NA
6 NA 2 2
My real data has many dataframes inside the list, and I have many lists, so I would like the code to not have to explicitly state the name of the dataframes, which I've been doing using the merge() function.
Thank you!