Learn R Programming

rdrop2 (version 0.8.2.1)

drop_download: Download a file from Dropbox to disk.

Description

Download a file from Dropbox to disk.

Usage

drop_download(
  path,
  local_path = NULL,
  overwrite = FALSE,
  progress = interactive(),
  verbose = interactive(),
  dtoken = get_dropbox_token()
)

Arguments

path

path to a file in Dropbox

local_path

path to save file to. If NULL (the default), saves file to working directory with same name. If not null, but a valid folder, file will be saved in this folder with same basename as path. If not null and not a folder, file will be saved to this path exactly.

overwrite

If TRUE, overwrite local file. Defaults to FALSE

progress

If TRUE, show a progress bar for large file downloads. Defaults to TRUE in interactive sessions, otherwise FALSE.

verbose

if TRUE, emit message giving location and size of the newly downloaded file. Defaults to TRUE in interactive sessions, otherwise FALSE.

dtoken

The Dropbox token generated by drop_auth. rdrop2 will try to automatically locate your local credential cache and use them. However, if the credentials are not found, the function will initiate a new authentication request. You can override this in drop_auth by pointing to a different location where your credentials are stored.

Value

TRUE if successful; error thrown otherwise.

References

API documentation

Examples

Run this code
# NOT RUN {
  # download a file to the current working directory
  drop_get("dataset.zip")

  # download again, overwriting previous result
  drop_get("dataset.zip", overwrite = TRUE)

  # download to a different path, keeping file name constant
  # will download to "some/other/place/dataset.zip"
  drop_get("dataset.zip", local_path = "some/other/place/")

  # download to to a different path, changing filename
  drop_get("dataset.zip", local_path = "some/other/place/not_a_dataset.zip")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab