I've done it from Dropbox. You just read in the complete list of files and then use stringr or something to figure out which one you want, then you read it. I can't recall if I did it from googledrive, only googlesheets.
I used this method:
https://shiny.rstudio.com/articles/persistent-data-storage.html#dropbox
# https://github.com/karthik/rdrop2#accessing-dropbox-on-shiny-and-remote-servers
library(rdrop2)
library(stringr)
# folder on the authenticated account
drop_folder <- "bull_data_files"
# regex pattern to look for in filenames
pattern <- "File_[0-9]{8}_[0-9]{4}EV"
# check/create dropbox authentication file
if (file.exists("token.rds")) {
token <- readRDS("token.rds")
} else {
token <- drop_auth() # launches a login page
saveRDS(token, "token.rds") # need to do this locally then deploy this file to shiny
}
# check dropbox files
dropfiles <- drop_dir(drop_folder, dtoken = token)$name
bv_file_csv_all <- str_extract(dropfiles, pattern = regex(str_c("^", pattern, ".csv$"), ignore_case = TRUE))
# download and then read latest version
bv_file_csv <- max(bv_file_csv_all, na.rm = TRUE)
drop_download(str_c(drop_folder, "/", bv_file_csv), progress = FALSE, verbose = FALSE, overwrite = TRUE, dtoken = token)
bv <- suppressMessages(readr::read_csv(bv_file_csv, guess_max = 25000, na = c("", "NA", "NULL")))