title: Appending a list in a loop (R)
body: <p>I want to use a loop to read in multiple csv files and append a list in R.</p>
  
  <pre><code>path = "~/path/to/csv/"
  file.names &lt;- dir(path, pattern =".csv")
  mylist=c()
  
  for(i in 1:length(file.names)){
  
    datatmp &lt;- read.csv(file.names[i],header=TRUE, sep=";", stringsAsFactors=FALSE)
    listtmp = datatmp[ ,6]
    finallist &lt;- append(mylist, listtmp)
  }
  finallist
  </code></pre>
  
  <p>For each csv file, the desired column has a different length. 
  In the end, I want to get the full appended list with all values in that certain column from all csv files.</p>
  
  <p>I am fairly new to R, so I am not sure what I'm missing...</p>