Download data from an existing release

  file = NULL,
  dest = usethis::proj_get(),
  repo = guess_repo(),
  tag = "latest",
  overwrite = TRUE,
  ignore = "manifest.json",
  use_timestamps = TRUE,
  show_progress = TRUE,
  .token = get_token()



name or vector of names of files to be downloaded. If NULL, all assets attached to the release will be downloaded.


name of vector of names of where file should be downloaded. Should be a directory or a list of filenames the same length as file vector. Can include paths to files, but any directories in that path must already exist.


Repository name in format "owner/repo". Will guess the current repo if not specified.


tag for the GitHub release to which this data is attached


Should any local files of the same name be overwritten? default TRUE.


a list of files to ignore (if downloading "all" because file=NULL).


If TRUE, then files will only be downloaded if timestamp on GitHub is newer than the local timestamp (if overwrite=TRUE). Defaults to TRUE.


logical, should we show progress bar for download? Defaults to TRUE.


GitHub authentication token. Typically set from an environmental variable, e.g. in a .Renviron file or with Sys.setenv(GITHUB_TOKEN = "xxxxx"), which helps prevent accidental disclosure of a secret token when sharing scripts.


# \donttest{ ## Download a specific file. ## (dest can be omitted when run inside and R project) piggyback::pb_download("data/iris.tsv.gz", repo = "cboettig/piggyback-tests", dest = tempdir())
#> Warning: file(s) data/iris.tsv.gz not found in repo cboettig/piggyback-tests
#> All files up-to-date already
# } if (FALSE) { ## Download all files piggyback::pb_download(repo = "cboettig/piggyback-tests", dest = tempdir()) }