I am looking to merge multiple pairs of data frames. For example I have following two set of data frames Con_2014, Con_2015, Con_2016 and Income_2014, Income_2015, Income_2016. So I want to merge data for each year like the following but at once.
Con_Income_2014 <- merge(Income_2014,Con_2014)
Con_Income_2015 <- merge(Income_2015,Con_2015)
Con_Income_2016 <- merge(Income_2016,Con_2016)`
I tried the following way but it does not work.
for (i in 1: length(years)){
assign(paste("Con_Income", as.character(years[i]),sep =""),merge(paste("Income_",as.character(years[i]),sep=""),paste("Cons_",as.character(years[i]),sep="")))}
It runs but it give me just name of each pairs. Its merging strings(the name of the file but not the data)