I have a dataframe df1 , which consists of columns from Var1 to Var10. Now I have taken a subset of columns as a dataframe df2 from Var5 to Var9, performed some operations and now I have to overwrite df1 with columns from df2.
I want to merge df2 ie var5 to var10 to df1(which also has var5 to var9 columns).
I tried below code:
merge(df1,df2,by.x = "",y="")
Ideally I have a lot of columns, specifying columns with comma isn't a great way