title: How to append each year from original separate files to new merge dataset
body: <p>I have 5 data files and each file name is xxx2014.dat, xxx2015.dat...xxx2018.dat. I merge these files together.</p>
  
  <p>Now, I want to append each year back in my new merge dataset, how can I do it in r?</p>
  
  <p>I try to use append() but I have no idea how r can know which row are 2014 or 2015...</p>
  
  <pre><code>yearslist = c("2014","2015","2016","2017","2018")
  
  for (year in yearslist) {
      filename = paste0("xxx", year, ".dat")
      dataname &lt;- assign(
          paste0("xxx", year),
          read_fwf(
              file = filename,
              fwf_positions(...),
              col_names = c("relationship","age","race","sex")
          )
      )
  }
  newmergedata &lt;- bind_rows(fileA,fileB)
  </code></pre>
  
  <p>I expected to get my new merge dataset have one column is corresponding years.</p>
  
  <pre><code>For example:
  Year     Sex     Region
  2014     001       1
  2014     002       1
  2015     001       2
  2018     002       1
  
  However, now I only have 
  Sex     Region
  001       1
  002       1
  001       2
  002       1 
  </code></pre>
  
  <p>How to find the value their corresponding year in new merge data?</p>