title: R read.dta and unz not working
body: <p>I read a lot of files into R from zipped sources. I try to use the R function <code>unz</code> to read from zipped files because unlike unzip it does not leave any unzipped files on my harddisk.</p>
  
  <p>However, this does not seem to work for zipped <code>*.dta</code> (Stata) files:</p>
  
  <pre><code>library(foreign)
  
  temp &lt;- tempfile()
  download.file("http://databank.worldbank.org/data/download/WDI_csv.zip", temp)
  wdi_unz &lt;- read.csv(unz(temp, "WDI_Data.csv"))
  unlink(temp)
  
  temp &lt;- tempfile()
  download.file("http://www.rug.nl/research/ggdc/data/pwt/v80/pwt80.zip",temp)
  pwt_unzip &lt;- read.dta(unzip(temp, "pwt80.dta"))
  pwt_unz   &lt;- read.dta(unz(temp, "pwt80.dta"))
  unlink(temp)
  </code></pre>
  
  <p>Sorry for using the rather large World Development Indicators database (its 40+ MB), but I did not find any better working example.</p>
  
  <p>The code produces an error when reading <code>pwt_unz</code>, [edit: but not when reading <code>pwt_unzip</code>]. What is the problem there? Probably it has something to do with the return value of <code>unz</code> not being compatible with the input for read.dta?</p>