title: How to download an .xlsx file in R and load the data into a dataframe?
body: <p>I'm trying to download an <code>.xlsx</code> file from the <code>eia</code> and getting the following error. </p>
  
  <p>The error is: <code>"Error: ZipException (Java): invalid entry size (expected 2385 but got 2390 bytes)"</code></p>
  
  <p>I have tried the following code:</p>
  
  <pre><code>library(XLConnect)
  tmp = tempfile(fileext = ".xlsx")
  download.file(url = "http://www.eia.gov/petroleum/drilling/xls/dpr-data.xlsx", destfile = tmp)
  readWorksheetFromFile(file = tmp, sheet = "Eagle Ford Region", header = FALSE, startRow = 9, endRow = 151)
  </code></pre>
  
  <p>I have tried the other recommendations at:
  <a href="https://stackoverflow.com/questions/24165623/read-excel-file-into-r-with-xlconnect-package-from-url">Read Excel file into R with XLConnect package from URL</a></p>