Source a file hosted in a pubic or private GitHub repo

source_github(repo, branch = "master", file, auth = Sys.getenv("GITHUB_PAT"))

Arguments

repo

Name of the GitHub repository in the form "user/repo".

branch

Branch from which to source the file (default master).

file

Filename to source, including relative path.

auth

Personal Access Token to use for authorization. Required to access files in private repositories. By default, checks for GITHUB_PAT environment variable. See https://help.github.com/articles/creating-an-access-token-for-command-line-use/.

Author

Alex Chubaty

Examples

if (FALSE) { # \dontrun{
repo = "PredictiveEcology/SpaDES"
branch = "development"
file = "_ignore/thinSpatialPolygons.R"
auth = "" ## your Personal Access Token

source_github(repo, branch, file, auth)
} # }