is it posiible to batch rename first variable in many dataframes acording to a vector ?
Let's say I have got a few dataframes d1 to d13. In each and every of these dataframes the first variable's name is Var1. I want to change this according to a vector:
c("PassengerId", "Survived", "Pclass","Name","Sex","Age","SibSp", "Parch","Ticket","Fare","Cabin","Embarked" ,"Survived_1") dfs <- list(df1, df2, df3, df4, df5, df6, df7, df8, df9, df10, df11, df12, df13)
So in df1 instead of Var1 it will change to "PassengerId".
My second question is: how to create such a list:
dfs <- list(df1, df2, df3,df4, df5,df6,df7,df8,df9,df10,df11,df12,df13)
I have done it by writing it down one by one as:
dfs <- list(df1:df13)
Thank you for your kind help.