This can be used within e.g., the options or params arguments for setupProject to get a ready-made file for a project.

getGithubFile(
  gitRepoFile,
  overwrite = FALSE,
  destDir = ".",
  verbose = getOption("Require.verbose")
)

Arguments

gitRepoFile

Character string that follows the convention GitAccount/GitRepo@Branch/File, if @Branch is omitted, then it will be assumed to be master or main.

overwrite

A logical vector of same length (or length 1) gitRepo. If TRUE, then the download will delete any existing folder with the same name as the repository provided in gitRepo

destDir

A directory to put the file that is to be downloaded.

verbose

Numeric or logical indicating how verbose should the function be. If -1 or -2, then as little verbosity as possible. If 0 or FALSE, then minimal outputs; if 1 or TRUE, more outputs; 2 even more. NOTE: in Require function, when verbose >= 2, the return object will have an attribute: attr(.., "Require") which has lots of information about the processes of the installs.

See also

Examples

filename <- getGithubFile("PredictiveEcology/LandWeb@development/01b-options.R",
                          destDir = Require::tempdir2())
#> Using GITHUB_PAT to access files on GitHub
#> downloaded 01b-options.R