Learn R Programming

mmstat4 (version 0.2.0)

ghget: ghget

Description

Makes a repository the active repository and downloads it if necessary. The parameter .tempdir is TRUE (default) then the repository is stored in the in the temporary directory tempdir() else in the application directory rappdirs::user_data_dir() for mmstat4. The parameter .tempdir is not logical then the value will be used as installation path.

Usage

ghget(..., .force = FALSE, .tempdir = TRUE, .quiet = !interactive())

Value

the name of the current key or nothing if unsuccessful

Arguments

...

parameters to set and activate a repository

.force

logical: download and unzip in any case? (default: FALSE)

.tempdir

logical or character: store download temporary or permanently (default: getOption("mmstat4.tempdir"))

.quiet

logical: show repository read attempts (default: !interactive())

  • if .tempdir==TRUE then the downloaded zip file will be stored temporarily in tempdir()

  • if .tempdir==FALSE then the downloaded zip file will be stored temporarily in rappdirs::user_data_dir()

  • otherwise it is assumed that you give the name of an existing directory to store the downloaded zip file

Details

Note, the list of repository names, directories and urls is stored in the installation directory, too.

Examples

Run this code
if (interactive()) {
  # get one of the default ZIP file from internet
  ghget("hu.data")
  # get a locally stored zip file
  ghget(dummy2=system.file("zip", "mmstat4.dummy.zip", package="mmstat4"))
  # get from an URL
  ghget(dummy.url="https://github.com/sigbertklinke/mmstat4.dummy/archive/refs/heads/main.zip")
}

Run the code above in your browser using DataLab