title: Opening many large SAS files in R
body: <p>I have 38 SAS files (300MB each) which I open with the read.xport function from the foreign library. I open them in the following way:</p>
  
  <pre><code>library(foreign)
  library(plyr)
  my.files &lt;- list.files(pattern="*.xpt")
  list_of_data = llply(filenames, read.xport)
  </code></pre>
  
  <p>This works perfect when I only have up to 4 files, but for all 38 I get a memory overload (obsiously) because R wants to store them all in one list file. I understand that this is what llply is supposed to do. Is there a way to import all .xpt files as a seperate data.frame or data.table? That I just have 38 objects. </p>
  
  <p>What could also cause the memory overload is that the data has got 3000 variables (columns), and I only need 30. Maybe it is possible to import the file, keep those 30 variables and import the next file. I know how to do this line by line, but I would like to write it in a loop.</p>
  
  <pre><code>file_one &lt;- read.xport("file1.xpt")
  file_one_selection &lt;- data.frame(date=file_one$date,bank=file_one$bank.... etc)
  rm(file_one)
  </code></pre>
  
  <p>Many thanks in advance.
  Best regards,</p>
  
  <p>Tim</p>