title: Reading CSVs from a folder on R
body: <pre><code> d &lt;- NULL   
   datafiles &lt;- list.files(path = "C:___")
          for (i in datafiles){
          print(i)
          j &lt;- read.csv(i, header = T)
          j$file &lt;- i
               d &lt;- rbind(d, j)
          }
  </code></pre>
  
  <p>When I ran just the print line, all of the csv names in the folder were displayed, but everything beyond the j &lt;- line, an error pops up. When I ran the entire code, the error I got says: </p>
  
  <pre><code>     Error in file(file, "rt") : cannot open the connection In addition:              
   Warning message:
       In file(file, "rt") :
      cannot open file 'xxx.csv': No such file or directory
  </code></pre>
  
  <p>Any suggestions would be appreciated, thanks!</p>