0

I have searched far and wide and can't figure out my problem. I am trying to combine multiple data frames in R based on the column name. In my data frames, not every one has the same number and order of columns, but the column headers frame to frame are uniform. I used full_join but I end up with the dataset adding columns. rbind does not work as not each frame has the same amount of columns. Any advise is very welcome. Thank you.

  • Use `dplyr::bind_rows` – akrun Sep 15 '21 at 23:50
  • 1
    *"not every one has the same number and order of columns"* and then *"column headers frame to frame are uniform"* seem contradictory. If you think that adding columns is incorrect, then full/inner/left/right-joins are out, period. Due to inconsistencies and/or misunderstandings, this is a great opportunity for you to *demonstrate* your issue: please make this question *reproducible* by adding sample data, code attempted, and expected output. Please see: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info – r2evans Sep 16 '21 at 00:31
  • Thank you. Apologies, what I mean is the titles to the columns are uniform the data in them. So for example one set of columns is X, Y, Z and one set is A,B,X,Y,Z. not every data sets have the same number of columns, but if there is overlap, they are named the same. – Park990 Sep 16 '21 at 01:42

0 Answers0