I have two large data frames(df1 and df2). I want to combine them using rbind function:
df<-rbind(df1,df2)
However, I get an error:
Error in match.names(clabs, names(xi)) :
names do not match previous names
There more than 100 variables in the data frames. I know most names match. One or two names may not match. How can I find unmatched column names of df1 and df2. I will be very glad for any help. Thanks a lot.
colnameswill give you the column names of adata.frame. If they don't match, you can set the column names of one of them and thenrbindthem. For instancecolnames(df2)<-colnames(df1);df<-rbind(df1,df2). What's the purpose of thefillargument? - nicolafillargument inrbind. I have the last R version (3.1.2). - nicola