title: R exdir does not exist error
body: <p>I'm trying to download and extract a zip file using R. Whenever I do so I get the error message</p>
  
  <blockquote>
    <p>Error in unzip(temp, list = TRUE) : 'exdir' does not exist</p>
  </blockquote>
  
  <p>I'm using code based on the Stack Overflow question <a href="https://stackoverflow.com/questions/3053833/using-r-to-download-zipped-data-file-extract-and-import-data">Using R to download zipped data file, extract, and import data</a></p>
  
  <p>To give a simplified example:</p>
  
  <pre><code># Create a temporary file
  temp &lt;- tempfile()
  
  # Download ZIP archive into temporary file
  download.file("http://cran.r-project.org/bin/windows/contrib/r-release/ggmap_2.2.zip",temp)
  
  # ZIP is downloaded successfully:
  
  # trying URL 'http://cran.r-project.org/bin/windows/contrib/r-release/ggmap_2.2.zip'
  # Content type 'application/zip' length 4533970 bytes (4.3 Mb)
  # opened URL
  # downloaded 4.3 Mb
  
  # Try to do something with the downloaded file
  unzip(temp,list=TRUE)
  
  # Error in unzip(temp, list = TRUE) : 'exdir' does not exist
  </code></pre>
  
  <p>What I've tried so far:</p>
  
  <ul>
  <li>Accessing the temp file manually and unzipping it with 7zip: Can do this no problem, file is there and accessible.</li>
  <li>Changing the temp directory to c:\temp. Again, the file is downloaded successfully, I can access it and unzip it with 7zip but R throws the exdir error message when it tries to access it.</li>
  </ul>
  
  <p>R version 2.15.2</p>
  
  <p>R-Studio version 0.97.306</p>
  
  <p><strong>Edit:</strong> The code works if I use <a href="http://stat.ethz.ch/R-manual/R-devel/library/base/html/connections.html" rel="noreferrer">unz</a> instead of <a href="http://stat.ethz.ch/R-manual/R-devel/library/utils/html/unzip.html" rel="noreferrer">unzip</a> but I haven't been able to figure out why one works and the other doesn't. From CRAN guidance:</p>
  
  <ul>
  <li>unz reads (only) single files within zip files...</li>
  <li>unzip extracts files from or list a zip archive</li>
  </ul>