title: R download file redirect
body: <p>Hi I am following a online class and trying to download the <code>rda</code> dataset provided by the prof.</p>
  
  <p>I tried to run exactly the same command as provided in the class:</p>
  
  <pre><code>download.file("https://dl.dropbox.com/u/7710864/courseraPublic/samsungData.rda", destfile="./samsungData.rda", method="curl")
  load('./samsungData.rda')
  </code></pre>
  
  <p>When I go to the download folder, open the <code>rda</code> file in vi, this is what I see:</p>
  
  <pre><code>&lt;html&gt;
     &lt;head&gt;&lt;title&gt;Found&lt;/title&gt;&lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;Found&lt;/h1&gt;
      &lt;p&gt;The resource was found at &lt;a href="https://dl.dropboxusercontent.com/u/7710864/courseraPublic/samsungData.rda"&gt;https://dl.dropboxusercontent.com/u/7710864/courseraPublic/samsungData.rda&lt;/a&gt;;
  you should be redirected automatically.
  
  &lt;!--  --&gt;&lt;/p&gt;
      &lt;hr noshade&gt;
      &lt;div align="right"&gt;WSGI Server&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Clearly there is a redirect here and the download file command did not follow it smartly. When I open up that URL in the browser, it will be successfully redirected.</p>
  
  <p>I took a look at the help manual of <code>download.file</code> there is no such thing as following redirect. </p>
  
  <p><em><strong>Can anyone show me how to follow the redirect?</em></strong></p>