This function downloads a file from Google Drive. Native Google file types, such as Google Docs, Google Sheets, and Google Slides, must be exported to a conventional local file type. This can be specified:
file: Something that identifies the file of interest on your Google Drive. Can be a name or path, a file id or URL marked with as_id(), or a dribble.
path: Character. Path for output file. If absent, the default file name is the file's name on Google Drive and the default location is working directory, possibly with an added file extension.
type: Character. Only consulted if file is a native Google file. Specifies the desired type of the exported file. Will be processed via drive_mime_type(), so either a file extension like "pdf" or a full MIME type like "application/pdf" is acceptable.
overwrite: A logical scalar. If local path already exists, do you want to overwrite it?
verbose: This logical argument to individual googledrive functions is deprecated. To globally suppress googledrive messaging, use options(googledrive_quiet = TRUE) (the default behaviour is to emit informational messages). To suppress messaging in a more limited way, use the helpers local_drive_quiet() or with_drive_quiet().
Returns
An object of class dribble, a tibble with one row per file.
Examples
# Target one of the official example files(src_file <- drive_example_remote("chicken_sheet"))# Download Sheet as csv, explicit typedownloaded_file <- drive_download(src_file, type ="csv")# See local path to new filedownloaded_file$local_path
# Download as csv, type implicit in file extensiondrive_download(src_file, path ="my_csv_file.csv")# Download with default name and type (xlsx)drive_download(src_file)# Clean upunlink(c("chicken_sheet.csv","chicken_sheet.xlsx","my_csv_file.csv"))