Simplest way to get rbind to ignore column names
问题 This came up just in an answer to another question here. When you rbind two data frames, it matches columns by name rather than index, which can lead to unexpected behavior: > df<-data.frame(x=1:2,y=3:4) > df x y 1 1 3 2 2 4 > rbind(df,df[,2:1]) x y 1 1 3 2 2 4 3 1 3 4 2 4 Of course, there are workarounds. For example: rbind(df,rename(df[,2:1],names(df))) data.frame(rbind(as.matrix(df),as.matrix(df[,2:1]))) On edit: rename from the plyr package doesn't actually work this way (although I