I have 20 different dataframes that have two equal columns (year, rn) but one column is named slightly different in each DF (pci1995$complexity_index_product
, pci1995$complexity_index_product
etc.).
I want a dataframe with three columns that merges basically all dataframes below each other (rn
, year
, pci
)
When I try:
pci_allyears<-bind_rows(pci_df1995,
pci_df1996,
pci_df1997,
pci_df1998,)
I get one year and on rn column with all the values, but unfortunately each pci column is still shown as separate column because they are of course not identical (differ by year). How can I fix this to have only three columns?