Note that there are some explanatory texts on larger screens.

plurals
  1. POzip file error in reading in an https url
    text
    copied!<p>I'm attempting to learn how to read in an access/zip file that has an https url into R. This is part of a larger mapping learning project I'm undertaking to branch out my R skills found <a href="http://www.talkstats.com/showthread.php/23324-An-R-learning-project-%28feel-free-to-learn-with-me%29?p=76655&amp;viewfull=1#post76655" rel="nofollow">HERE</a> <em>(I will link this post back there as well)</em>.</p> <p><strong>This was the plan but I get an error from the getURL and I'm not sure why:</strong></p> <pre><code>require(RCurl) NYSdemo &lt;- getURL("https://reportcards.nysed.gov/zip/SRC2010.zip") temp &lt;- tempfile() download.file(NYSdemo, temp) data &lt;- read.table(unz(temp, "a1.dat")) unlink(temp) </code></pre> <p><strong>ERROR:</strong></p> <pre><code>&gt; NYSdemo &lt;- getURL("https://reportcards.nysed.gov/zip/SRC2010.zip") Error in function (type, msg, asError = TRUE) : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed </code></pre> <p>Like I said this is a learning project so many of the techniques I'm using here I am not at all familiar with.</p> <p>The actual zip file I'm trying to download is <a href="https://reportcards.nysed.gov/view.php?county=yes&amp;year=2010" rel="nofollow">HERE</a></p> <p>Maybe this isn't actually a programming problem but something wrong with the URL that doesn't enable getURL to be used on it.</p> <p>Thank you in advance for your ideas and help.</p> <p><em><strong>EDIT: I attempted the ssl.verifypeer but get another error</em></strong></p> <pre><code>&gt; NYSdemo &lt;- getURL("https://reportcards.nysed.gov/zip/SRC2010.zip", + ssl.verifypeer = FALSE) Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : embedded nul in string: 'PK\003\004\024\0\0\0\b\0i[j&gt;¶U#]tó\036\005\0 ÷- {And it continues} &gt; </code></pre> <p><em><strong>EDIT 2: Per Vincent's Suggestions</em></strong></p> <pre><code>&gt; NYSdemo &lt;- getURL("http://reportcards.nysed.gov/zip/SRC2010.zip") &gt; download.file(NYSdemo, temp) Error in download.file(NYSdemo, temp) : unsupported URL scheme &gt; &gt; NYSdemo &lt;- getBinaryURL("https://reportcards.nysed.gov/zip/SRC2010.zip") Error in function (type, msg, asError = TRUE) : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed &gt; &gt; url.exists("https://reportcards.nysed.gov/zip/SRC2010.zip") [1] FALSE #not sure why this is because it works to type into url bar of browser </code></pre> <p>This information is leading me to believe that the problem is something strange about the zip file. Ideas?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload