githubGet: Download a file from GitHub

View source: R/getData.R

githubGetR Documentation

Download a file from GitHub

Description

Given the file name, repository, and commit/tag/branch, downloads the specified (public) file from GitHub unless it already exists or is forced. Does not support private repositories or directories.

Usage

githubGet(file, repo, commit, dir = "./", force = FALSE, sha256 = NULL, ...)

Arguments

file

The name of the file to download

repo

The repository to download from, e.g. "Jefferys/JefferysRUtils"

commit

The commit, tag, or branch to download.

dir

The directory to download to, by default the current working directory.

force

Download and over-write if already exists in output directory.

sha256

Expected SHA256 checksum.

...

Other parameters to pass through to download.file

Value

The exit code from download.file - 0 for success, positive integer for error, and NA if not attempted due to an existing file.

Examples

## Not run: 
githubGet( "README.Rmd", repo= Jefferys/JefferysRUtils,
           commit= 'e5dab82f022afa311be9d078d3e080fb88a2cfaf' )
githubGet( "README.Rmd", repo= Jefferys/JefferysRUtils,
           commit= 'dev' )

## End(Not run)

jefferys/JefferysRUtils documentation built on Jan. 12, 2024, 9:18 p.m.