So my script below reads a csv from google drive:
---
title: "Funnel"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
runtime: shiny
---
#rm(list = ls())
library(flexdashboard)
library(dplyr)
library(ggplot2)
library(collapsibleTree)
library(rsconnect)
library(shiny)
library(googledrive)
options(shiny.sanitize.errors = FALSE)
#id = '1Jj6nj1FivQHC7b5yzd3JeFfPwyTHbsGr'
#df = read.csv(paste0("https://docs.google.com/uc?id=",id,"&export=download"))
id = "1Jj6nj1FivQHC7b5yzd3JeFfPwyTHbsGr"
df = read.csv(sprintf("https://docs.google.com/uc?id=%s&export=download", id))
The weird part is I get this error despite trouble shooting it 20x times
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&export=download'
When i see my dataframe object which is supposed to return a table, I get this mess:
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 </style><script nonce=8+qjBlQaWdaiN/Ce45c+kQ></script></head><body><div id=gbar><nobr><a target=_blank class=gb1 href=https://www.google.com/webhp?tab=ow>Search</a> <a target=_blank class=gb1 href=http://www.google.com/imghp?hl=en&tab=oi>Images</a> <a target=_blank class=gb1 href=https://maps.google.com/maps?hl=en&tab=ol>Maps</a> <a target=_blank class=gb1 href=https://play.google.com/?hl=en&tab=o8>Play</a> <a target=_blank class=gb1 href=https://www.youtube.com/?gl=US&tab=o1>YouTube</a> <a target=_blank class=gb1 href=https://news.google.com/?tab=on>News</a> <a target=_blank class=gb1 href=https://mail.google.com/mail/?tab=om>Gmail</a> <b class=gb1>Drive</b> <a target=_blank class=gb1 style=text-decoration:none href=https://www.google.com/intl/en/about/products?tab=oh><u>More</u> »</a></nobr></div><div id=guser width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf></span><span id=gbe></span><a target=_self href=/settings?hl=en_US class=gb4>Settings</a> | <a target=_blank href=//support.google.com/drive/?p=web_home&hl=en_US class=gb4>Help</a> | <a target=_top id=gb_70 href=https://accounts.google.com/ServiceLogin?hl=en&passive=true&continue=https://docs.google.com/uc%3Fid%3D1Jj6nj1FivQHC7b5yzd3JeFfPwyTHbsGr%26export%3Ddownload&service=writely&ec=GAZAMQ class=gb4>Sign in</a></nobr></div><div class=gbh style=left:0></div><div class=gbh style=right:0></div><div class=uc-main><div id=uc-text><p class=uc-error-caption>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't given you permission to download this file.</p><p class=uc-error-subcaption>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.</p></div></div><div class=uc-footer><hr class=uc-footer-divider>© 2021 Google - <a class=goog-link href=//support.google.com/drive/?p=web_home>Help</a> - <a class=goog-link href=//support.google.com/drive/bin/answer.py?hl=en_US&answer=2450387>Privacy & Terms</a></div></body></html>
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
Or in a different view:
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.
