I have 3 data frames with the same amount of columns and I want to bind them together (bind them by columns on top of each other). The problem is that these data frames come from different sources and some of the columns are slightly different, for example: df1- column A- dollar amount, df2- column A-dollar amount (USD), and R doesn't know they are the same. I tried this:
colnames(df1)=colnames(df2)
It worked, but the problem is that when I try to export the merged file, each time the name of the column is different- sometimes it's 'dollar amount' and sometimes it's 'dollar amount (USD)'.
Is there something that can be done automatically? I have over 40 columns in this data frame.
Thanks!!