I want to merge 3 data frames which are different. I have one with few rows and another one with different Key.see the data frames below
df1 <- data.frame(date = c("12/03/2013","12/03/2013","12/03/2013"), f1 = c(189,256,389), f2 = c("NY","MB","LT"))
df2 <- data.frame(date = c("12/03/2013","12/03/2013"), Added_f1 = c(178,49), added_f2 = c("okr","nor"))
df3 <- data.frame(date = c("07/09/2016","07/09/2016","07/09/2016"), f1 = c(190,200,367), f5 = c("so","yo","kl"),f7 = c("sott","yogh","klop"))
I do want to merge them using the date as the key. I have tried these options but it generates an error of mismatch, **must specify a uniquely valid* column*
Reduce(function(x,y) merge(x,y,by="date",all=TRUE) ,list(df1,df2,df3))
Note that column names can be different in each data frame. The second data frame can be merged on the right since columns are totally different but how can a third data frame be merged since the key is different and columns can have those matching and others which don't. I do want one table as a result.
dates, notdate. That is what the error message tells you: you don't have the column to merge - denis