get_repo: Download a GitHub Repository

View source: R/get_repo.R

get_repoR Documentation

Download a GitHub Repository

Description

This function allows to download a whole repository from GitHub.com. It is intended as a convenience function for students working with Introduction to Econometrics with R, an interactive online-companion to the textbook Introduction to Econometrics (Stock & Watson 2015), but works with any public GitHub repository. The companion can be found here.

Usage

get_repo(repo = NULL, out = ".")

Arguments

repo

A character string stating the name of the GitHub repository to be downloaded. Must be specified in the form "username/repository".

out

A character string specifying the path to the output directory where the repository files will be saved. Defaults to the current working directory.

Details

The function downloads the zipped contents (master.zip) of the master branch from the GitHub repository supplied to the argument repo to the directory specified in out and unzips the archive afterwards in <out>/Repository/.

References

Stock, J. H. and Watson, M. W. (2015). Introduction to Econometrics, Third Update, Global Edition. Pearson Education Limited.

Examples

## Not run: 
# download the bookdown projekt repository
# "mca91/EconometricsWithR"
get_repo(repo = "mca91/EconometricsWithR")

## End(Not run)

mca91/itewrpkg documentation built on Nov. 10, 2023, 12:03 p.m.