title: R read all files in a directory
body: <p>I am trying to read and merge together all the csv files in a directory. I found this excellent SO answer: <a href="https://stackoverflow.com/questions/11433432/importing-multiple-csv-files-into-r">Importing multiple .csv files into R</a> but it doesn't seem to work for me.</p>
  
  <p>I am able to list the files (they are in my home directory in a sub-folder called "test"):</p>
  
  <pre><code>library(data.table)  
  files &lt;- list.files(path = "test",pattern = ".csv")
  print(files)
  </code></pre>
  
  <p>This correctly prints the content of the directory.</p>
  
  <p>When I try to load them using</p>
  
  <pre><code>temp &lt;- lapply(files, fread, sep=",")
  data &lt;- rbindlist(temp)
  </code></pre>
  
  <p>I get <code>File 'xyz.csv' does not exist. Include one or more spaces to consider the input a system command.</code></p>
  
  <p>Do I have to somehow specify the path again? I fought that this information is already contained in the file object. Thanks for any help!</p>