title: Read multiple “.xlsx” files
body: <p>I am trying to read multiple excel files under different folders by R</p>
  <p>Here is my solution:</p>
  <pre><code>    setwd(&quot;D:/data&quot;)
      filename &lt;- list.files(getwd(),full.names = TRUE) 
  # Four folders &quot;epdata1&quot; &quot;epdata2&quot; &quot;epdata3&quot; &quot;epdata4&quot; were inside the folder &quot;data&quot; 
      dataname &lt;- list.files(filename,pattern=&quot;*.xlsx$&quot;,full.names = TRUE)
  # Every folder in the folder &quot;data&quot; contains five excel files
      datalist &lt;- lapply(dataname,read_xlsx)
  
      Error: `path` does not exist:'D:/data/epidata1/出院舱随访1.xlsx'
  </code></pre>
  <p>But read_xlsx was successfully run</p>
  <pre><code>   read_xlsx(&quot;D:/data/epidata1/出院舱随访1.xlsx&quot;)
  </code></pre>
  <p>All file directories are available in the &quot;data&quot; folder and why R fails to read those excel file?</p>
  <p>Your help will much appreciated!</p>