title: Reading CSV From R returning an error and weird html
body: <p>So my script below reads a csv from google drive:</p>
  <pre><code>   ---
  title: &quot;Funnel&quot;
  output:
    flexdashboard::flex_dashboard:
      orientation: rows
      vertical_layout: fill
  runtime: shiny
  ---
  </code></pre>
  <pre><code>
  #rm(list = ls())
  
  library(flexdashboard)
  library(dplyr)
  library(ggplot2)
  library(collapsibleTree)
  library(rsconnect)
  library(shiny)
  library(googledrive)
  options(shiny.sanitize.errors = FALSE)
  </code></pre>
  <pre><code>#id = '1Jj6nj1FivQHC7b5yzd3JeFfPwyTHbsGr'
  #df = read.csv(paste0(&quot;https://docs.google.com/uc?id=&quot;,id,&quot;&amp;export=download&quot;))
  
  id = &quot;1Jj6nj1FivQHC7b5yzd3JeFfPwyTHbsGr&quot;
  df = read.csv(sprintf(&quot;https://docs.google.com/uc?id=%s&amp;export=download&quot;, id))
  
  
  </code></pre>
  <p>The weird part is I get this error despite trouble shooting it 20x times</p>
  <pre><code>Warning message:
  In read.table(file = file, header = header, sep = sep, quote = quote,  :
    incomplete final line found by readTableHeader on 'https://docs.google.com/uc?id=1Jj6nj1FivQHC7b5yzd3JeFfPwyTHbsGr&amp;export=download'
  </code></pre>
  <p>When i see my dataframe object which is supposed to return a table, I get this mess:</p>
  <pre><code>                                                                                                                                             X..DOCTYPE.html..html..head..title.Google.Drive...Can..39.t.download.file..title..meta.http.equiv.content.type.content.text.html..charset.utf.8...link.href...47.static..47.doclist..47.client..47.css..47.2417655298..45.untrustedcontent.css.rel.stylesh ...
  1 &lt;/style&gt;&lt;script nonce=8+qjBlQaWdaiN/Ce45c+kQ&gt;&lt;/script&gt;&lt;/head&gt;&lt;body&gt;&lt;div id=gbar&gt;&lt;nobr&gt;&lt;a target=_blank class=gb1 href=https://www.google.com/webhp?tab=ow&gt;Search&lt;/a&gt; &lt;a target=_blank class=gb1 href=http://www.google.com/imghp?hl=en&amp;tab=oi&gt;Images&lt;/a&gt; &lt;a target=_blank class=gb1 href=https://maps.google.com/maps?hl=en&amp;tab=ol&gt;Maps&lt;/a&gt; &lt;a target=_blank class=gb1 href=https://play.google.com/?hl=en&amp;tab=o8&gt;Play&lt;/a&gt; &lt;a target=_blank class=gb1 href=https://www.youtube.com/?gl=US&amp;tab=o1&gt;YouTube&lt;/a&gt; &lt;a target=_blank class=gb1 href=https://news.google.com/?tab=on&gt;News&lt;/a&gt; &lt;a target=_blank class=gb1 href=https://mail.google.com/mail/?tab=om&gt;Gmail&lt;/a&gt; &lt;b class=gb1&gt;Drive&lt;/b&gt; &lt;a target=_blank class=gb1 style=text-decoration:none href=https://www.google.com/intl/en/about/products?tab=oh&gt;&lt;u&gt;More&lt;/u&gt; &amp;raquo;&lt;/a&gt;&lt;/nobr&gt;&lt;/div&gt;&lt;div id=guser width=100%&gt;&lt;nobr&gt;&lt;span id=gbn class=gbi&gt;&lt;/span&gt;&lt;span id=gbf class=gbf&gt;&lt;/span&gt;&lt;span id=gbe&gt;&lt;/span&gt;&lt;a target=_self href=/settings?hl=en_US class=gb4&gt;Settings&lt;/a&gt; | &lt;a target=_blank  href=//support.google.com/drive/?p=web_home&amp;hl=en_US class=gb4&gt;Help&lt;/a&gt; | &lt;a target=_top id=gb_70 href=https://accounts.google.com/ServiceLogin?hl=en&amp;passive=true&amp;continue=https://docs.google.com/uc%3Fid%3D1Jj6nj1FivQHC7b5yzd3JeFfPwyTHbsGr%26export%3Ddownload&amp;service=writely&amp;ec=GAZAMQ class=gb4&gt;Sign in&lt;/a&gt;&lt;/nobr&gt;&lt;/div&gt;&lt;div class=gbh style=left:0&gt;&lt;/div&gt;&lt;div class=gbh style=right:0&gt;&lt;/div&gt;&lt;div class=uc-main&gt;&lt;div id=uc-text&gt;&lt;p class=uc-error-caption&gt;Sorry
                                                      X.guser.font.size.13px.padding.top.0px..important...gbar.height.22px..guser.padding.bottom.7px..important.text.align.right..gbh
  1  the owner hasn&amp;#39;t given you permission to download this file.&lt;/p&gt;&lt;p class=uc-error-subcaption&gt;Only the owner and editors can download this file. If you'd like to download it
                                                                                                                                      .gbd.border.top.1px.solid..c9d7f1.font.size.1px..gbh.height.0.position.absolute.top.24px.width.100...media.all..gb1.height.22px.margin.right..5em.vertical.align.top..gbar.float.left..a.gb1
  1  please contact the owner.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=uc-footer&gt;&lt;hr class=uc-footer-divider&gt;&amp;copy; 2021 Google - &lt;a class=goog-link href=//support.google.com/drive/?p=web_home&gt;Help&lt;/a&gt; - &lt;a class=goog-link href=//support.google.com/drive/bin/answer.py?hl=en_US&amp;amp;answer=2450387&gt;Privacy &amp; Terms&lt;/a&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;
    a.gb4.text.decoration.underline..important.a.gb1
  1                                               NA
    a.gb4.color..00c..important..gbi..gb4.color..dd8e27..important..gbf..gb4.color..900..important.
  1
  </code></pre>
  <p>Or in a different view:</p>
  <p><a href="https://i.stack.imgur.com/1rQAt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1rQAt.png" alt="Error screen shot" /></a></p>
  <p>Unfortunately, while it works if I download the csv and read it, I was hoping to just read it through the g-drive without downloading it locally.</p>