addPackage {microCRAN}R Documentation

Adds a package-file to the repository

Description

Methods for taking a file (".tar.gz", ".zip", ".tgz") and placing it in the repository, all locally.

Usage

addPackage(
  fn,
  type = c("source", "mac.binary", "win.binary"),
  repo_dir,
  is.new = TRUE
)

Arguments

fn

Path to package

type

Type of package, see explanation in section "Binary packages" in utils::install.packages().

repo_dir

Path to local directory, where the root of the repository is. The (source) packages will be stored locally at ⁠{repo_dir}/src/contrib/⁠.

is.new

Logical, if TRUE, it causes an error if the file

Value

Invisibly returns the number of packages described in the resulting 'PACKAGES', 'PACKAGES.gz' and 'PACKAGES.rds' files. If 0, no packages were found and no files were written.

See Also

miniCRAN::addLocalPackage(), tools::write_PACKAGES()

Examples

f <- system.file('extdata/microCRAN_0.1.0.zip', package = 'microCRAN', mustWork = TRUE)
root <- tempdir()
addPackage(f, type = 'win.binary', repo_dir = root)


[Package microCRAN version 0.9.0-1 Index]