pb_download: Download data from an existing release

View source: R/pb_download.R

pb_downloadR Documentation

Download data from an existing release

Description

Download data from an existing release

Usage

pb_download(
  file = NULL,
  dest = ".",
  repo = guess_repo(),
  tag = "latest",
  overwrite = TRUE,
  ignore = "manifest.json",
  use_timestamps = TRUE,
  show_progress = getOption("piggyback.verbose", default = TRUE),
  .token = gh::gh_token()
)

Arguments

file

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

dest

name of vector of names of where file should be downloaded. Can be a directory or a list of filenames the same length as file vector. Any directories in the path provided must already exist.

repo

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

tag

tag for the GitHub release to which this data should be attached.

overwrite

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

ignore

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

use_timestamps

DEPRECATED.

show_progress

logical, show a progress bar be shown for uploading? Defaults to TRUE - can also set globally with options("piggyback.verbose")

.token

GitHub authentication token, see [gh::gh_token()]

Examples

## Not run: 
 ## Download a specific file.
 ## (dest can be omitted when run inside and R project)
 piggyback::pb_download("iris.tsv.gz",
                        repo = "cboettig/piggyback-tests",
                        dest = tempdir())

## End(Not run)
## Not run: 
 ## Download all files
 piggyback::pb_download(repo = "cboettig/piggyback-tests",
                        dest = tempdir())


## End(Not run)

piggyback documentation built on May 20, 2022, 1:07 a.m.