getGithubFile: Convenience wrapper to get (download) one or more files from...

getGithubFileR Documentation

Convenience wrapper to get (download) one or more files from a Github repo.

Description

The function retrieves one or more files from a Github repo via download.file.

Usage

getGithubFile(
  github.user,
	repo,
	branch="master",
	github.directory=NULL,
  file.to.get=NULL,
	local.directory="github_files",
	file.type = "[.]R$|[.]Rmd$",
	quiet=FALSE)

Arguments

github.user

Character. Name of github user or organization who owns the repo you want to get file(s) from.

repo

Character. The repo in which file(s) are located.

branch

Character. Repo branch in which to look. Default is ‘master’.

github.directory

Character. Additional directory structure within the repo branch in which to look. Default is NULL, meaning the whole repo.

file.to.get

Character. Specific (single) file to get within the repo/branch/github.directory. Default is NULL, meaning all files in the repo/branch/github.directory path.

local.directory

Character. Local directory in which to download files. Default is ‘github_files’. A directory of this name will be created in the working directory if it does not already exist.

file.type

Character. Specific file type (or other special text in which to grep from the list of files in the repo) to limit files that are retrieved. Default is ‘[.]R$|[.]Rmd$’, which will get all .R and .Rmd files.

quiet

Boolean. Logical - should download progress be shown. Defaults to ‘FALSE’. See download.file for details.

Examples

## Not run: 
getGithubFile(github.user = "CenterForAssessment", repo = "SGP_Research",
              github.directory = "Master_Documents/Skip_Year_Analysis/SGP_Report",
              local.directory = file.path("assets", "github_children"), file.type = ".Rmd$")

## End(Not run)

CenterForAssessment/Literasee documentation built on July 2, 2023, 6:21 p.m.