I have four data frames for four different river data sets (the rivers are Main, Danube, Isar and Inn). The data frames are all of the same dimensions and are named as follows: "df_Main", "df_Danube", "df_Isar" and "df_Inn". In order for handy plotting afterwards, I need all the data frames to have the same column names. I thought it can easily be achieved by this:
rivers <- c("Main", "Danube", "Isar", "Inn")
for (i in 1:length(rivers)) {
colnames(get(paste0("df_", rivers[i]))) <- c("bla", "bla", "bla", "bla")
}
But that does not work. Anybody with an idea?
setNames