View source: R/drive_transfer.R
cloud_drive_download | R Documentation |
Retrieves a file from the project's Google Drive folder and saves it to the local project folder, maintaining the original folder structure.
cloud_drive_download(file, root = NULL)
file |
Path to a file relative to project folder root. Can contain only letters, digits, '-', '_', '.', spaces and '/' symbols. |
root |
Google Drive ID or URL of the project root. This serves as the
reference point for all relative paths. When left as |
Google Drive file structure is different from the usual file structure like e.g. on Linux or Windows. A folder on Google Drive can have two or more child folders with the same name. Google Drive marks files and folders with so-called id values to distinguish between them. These values are always unique. You can see them in browser URL for example. The concept of "name" is in the first place for convenience of the end user.
In such a setup a relative file path may correspond to multiple files or folders. This function however works under assumption that the relative path you pass to it defines strictly one object. If there's any ambiguity it throws an error.
Invisibly returns NULL
after successfully downloading the file.
# downloads toy_data/demo.csv from project's Google Drive folder
# (provided it exists) and saves it to local 'toy_data' folder
cloud_drive_download("toy_data/demo.csv")
# clean up
unlink("toy_data", recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.