title: How put column name after make for loop with xlsx file
body: <p>I am looping to load multiple xlsx files. This I am doing well. But when I want to add the name of the columns of the documents (<em>the same names for all files</em>) I have not managed to do it.</p>
  <pre><code>library(dplyr)
  library(readr)
  library(openxlsx)
  library(readxl)
  
  setwd(&quot;C:/Users/MiguelAngel/Documents/R Miguelo/Guillermo Ahumada&quot;)
  ldf &lt;- list() 
  listxlsx &lt;- dir(pattern = &quot;*.xlsx&quot;)
  for (k in 1:length(listxlsx)){
    ldf[[k]] &lt;-as.data.frame(read.xlsx(listxlsx[k]))
  }
  </code></pre>
  <p><em>The result:</em>
  355 1500 1100 43831
  1   190  850  600 43832
  2    93 4000 3000 43833
  3   114 4000 3000 43834
  4   431 1000  700 43835
  5   182 1000  700 43836
  6   496  500  300 43837
  7   254  500  300 43838
  8   174  600  300 43839
  9   397 1500  945 43840
  10  198 1500  900 43841
  11  271 1500  900 43842
  12   94 3000 2000 43843
  13  206  400  230 43844
  14  305 1500 1100 43845
  15  184  850  600 43846
  16   90 4000 3000 43847
  17   70 4000 3000 43848
  18  492 1000  700 43849
  19  168 1000  700 43850
  20  530  500  300 43851</p>
  <p>They load all the files well but without the name of the columns.</p>
  <p><em>I need add the name of columns:</em></p>
  <pre><code>list_file &lt;- dir(pattern = &quot;*.xlsx&quot;) %&gt;% 
  lapply(read.xlsx) %&gt;% # *I use stringAsFactor but appear error.
  bind_rows 
  </code></pre>
  <p><em>but appear this</em>
  <a href="https://i.stack.imgur.com/hcZ9P.png" rel="nofollow noreferrer">list_file</a></p>
  <p><a href="https://i.stack.imgur.com/GpdyM.png" rel="nofollow noreferrer">Form of original columns all files</a></p>
  <p><em><strong>I need put this columns names after make the loop with for.</strong></em></p>
  <p><em>Thanks for help me guys</em></p>