3

I am still having trouble getting a large file (.rds) from google drive into R. The purpose is to pull the rds file from drive, for use in an Rshiny.app.

If I use

library(googledrive)
temp <- tempfile(fileext = ".rds")
dl <- drive_download(
  as_id("XXXXXXXXX"), path = temp, overwrite = TRUE)
myObj<-readRDS(file = dl$local_path)

It works fine, because it downloads the file by ID into the tempdir. But then it requires token auth for tidyverse (almost) every time.

There are other options using download.file() as in R How to read a file from google drive using R, however I am running into the issue that the share/download link leads to a prompt, notifying users of virus scan.

Google Drive Download Warning

I have tried direct download links, changing href, shareable link, with no success. Any ideas how I can work around this, using the share/download link and download.file()?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
  • Did you manage to do this? I am in the same situation, I want to use google drive to put the big rds file and I want to use it for shinyapps. Or do you manage to find other working alternatives? – Tengku Hanis Mar 31 '23 at 05:03

0 Answers0