title: Download a file from HTTPS using download.file()
body: <p>I would like to read online data to R using <code>download.file()</code> as shown below.</p>
  
  <pre><code>URL &lt;- "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv"
  download.file(URL, destfile = "./data/data.csv", method="curl")
  </code></pre>
  
  <p>Someone suggested to me that I add the line <code>setInternet2(TRUE)</code>, but it still doesn't work.</p>
  
  <p>The error I get is:</p>
  
  <pre><code>Warning messages:
  1: running command 'curl  "https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv"  -o "./data/data.csv"' had status 127 
  2: In download.file(URL, destfile = "./data/data.csv", method = "curl",  :
    download had nonzero exit status
  </code></pre>
  
  <p>Appreciate your help.</p>