drat (version 0.1.4)

pruneRepo: Prune repository from older copies of packages

Description

The function determines which packages in a repositories can be removed as they are being ‘shadowed’ by a newer version of the same packages.

Usage

pruneRepo(repopath = getOption("dratRepo", "~/git/drat"), type = "source",
  pkg, remove = FALSE)

Arguments

repopath

Character variable with the path to the repo; defaults to the value of the “dratRepo” option with “"~/git/drat"” as fallback

type

Character variable for the type of repository, so far “source”

pkg

Optional character variable specifying a package name, whose older versions should be pruned. If missing (the default), pruning is performed on all packages.

remove

Logical variable indicating whether files should be removed

Value

A data frame describing the repository is returned containing columns with columns “file”, “package” (just the name), “version” and a logical variable “newest” indicating if the package can be removed.

Details

Given a package name, R will always find the newest version of that package. Older versions are therefore effectively shadowed and can be removed without functionally changing a repository.

This function is still undergoing development and polish and may change in subsequent versions.