title: Accessing Excel file from Sharepoint with R
body: <p>am trying to write an R script that will access an Excel file that is stored on my company's Sharepoint page so that I can make a few calculations and plot the results.  I've tried various ways to do this (download.file, RCurl getURL(), gdata), but I can't seem to figure out how to do this.  The url is HTTPS and there should be a username and password required.  I've gotten the closest with this code:</p>
  
  <pre><code>require(RCurl)
  URL&lt;-"https://companyname.sharepoint.com/sites/folder/_layouts/15/WopiFrame.aspx?sourcedoc={2DCC2ED7-1C13-4910-AFAD-4A9ACFF1C797}&amp;file=myfile.xlsx&amp;action=default'  
  f&lt;-getURL(URL,verbose=T,ssl.verifyhost=F,ssl.verifypeer=F,userpwd="mylogin:mypw") 
  </code></pre>
  
  <p>This seems to connect (although the username and password don't seem to matter) and returns</p>
  
  <pre><code>&gt; f  
  [1] "&lt;html&gt;&lt;head&gt;&lt;title&gt;Object moved&lt;/title&gt;&lt;/head&gt;&lt;body&gt;\r\n&lt;h2&gt;Object moved to &lt;a href=\"https://companyname.sharepoint.com/sites/_layouts/15/WopiFrame2.aspx?sourcedoc={2DCC2ED7-1C13-4910-AFAD-4A9ACFF1C797}&amp;amp;file=MyFile.xlsx&amp;amp;action=default\"&gt;here&lt;/a&gt;.&lt;/h2&gt;\r\n&lt;/body&gt;&lt;/html&gt;\r\n"`
  </code></pre>
  
  <p>However, I'm not sure what to do at this point, or even if I'm on the right track.  Any help will be greatly appreciated.  </p>