get_repo_files: Download Files From GitHub Repository

View source: R/get_repo_files.R

get_repo_filesR Documentation

Download Files From GitHub Repository

Description

This function allows to download files from a specific folder located in a repository at 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 online-companion can be found here.

Usage

get_repo_files(
  repo = "mca91/EconometricsWithR",
  folder = "master",
  type = "any",
  out = "."
)

Arguments

repo

character A GitHub repository. Must be specified in the form "username/repository". Defaults to "mca91/EconometricsWithR".

folder

A character specifying the folder containing the files to be downloaded. Defaults to the master folder.

type

A vector of type character specifying the file type(s) to be downloaded. All file types will be downloaded by default.

out

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

References

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

Examples

# download datasets from "mca91/EconometricsWithR"
get_repo_files(folder = "master/data")

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