% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pkgDep.R
\name{cachePurge}
\alias{cachePurge}
\alias{purgeCache}
\title{Purge everything in the Require cache}
\usage{
cachePurge(packages = FALSE, repos = getOption("repos"))

purgeCache(packages = FALSE, repos = getOption("repos"))
}
\arguments{
\item{packages}{Either a character vector of packages to install via
\code{install.packages}, then load (i.e., with \code{library}), or, for convenience,
a vector or list (using \code{c} or \code{list}) of unquoted package names to install
and/or load (as in \code{require}, but vectorized). Passing vectors of names may
not work in all cases, so user should confirm before relying on this behaviour
in operational code.
In the case of a GitHub package, it
will be assumed that the name of the repository is the name of the package.
If this is not the case, then pass a \emph{named} character vector here, where the
names are the package names that could be different than the GitHub
repository name.
As a convenience for copy-pasting long lists, any character element that
contains newlines is split into one package per line, with whitespace
trimmed and blank or \verb{#}-prefixed lines dropped. For example,
\code{Require("\\n  dplyr\\n  # ggplot2\\n  PredictiveEcology/LandR@development\\n")}
is equivalent to
\code{Require(c("dplyr", "PredictiveEcology/LandR@development"))}.
Alternatively, an unquoted \code{{...}} block is accepted, with each line
treated as one package spec, e.g.
\code{Require({ dplyr; lme4; PredictiveEcology/LandR@development })}.
Note that R's parser strips comments inside \code{{...}} before this function
runs, so to omit a package delete the line (or comment it out -- both
have the same effect). Version constraints such as \verb{pkg (>= 1.0)} do
not parse inside \code{{...}} and must use the quoted string form.}

\item{repos}{The remote repository (e.g., a CRAN mirror), passed to either
\code{install.packages}, \code{install_github} or \code{installVersions}.
\strong{When \code{options(Require.usePak = TRUE)}:} \code{repos} is added to pak's repository
list via \code{options(repos)}. However, pak always includes CRAN and Bioconductor as
built-in defaults regardless of this setting -- \code{repos} can only \emph{add} sources,
it cannot prevent pak from also searching CRAN. This differs from the default
(\code{usePak = FALSE}) behaviour where \code{repos} strictly controls which repositories
are used. Use \code{pak::cache_clean()} to clear pak's download cache if needed.}
}
\value{
Run for its side effect, namely, all cached objects are removed.
}
\description{
Clears Require's own bookkeeping caches: the \code{available.packages()}
snapshot, the GitHub SHA database, the \code{DESCRIPTION} cache, and the
pkgDep memoisation database. These live under \code{\link[=cacheDir]{cacheDir()}} and are
distinct from the package binary tarball cache.
}
\details{
With \code{packages = TRUE}, the package binary cache is also cleared by
calling \code{\link[=cacheClearPackages]{cacheClearPackages()}} -- which under \code{usePak = TRUE} (the
default) delegates to \code{pak::cache_clean()}, and under the legacy path
walks Require's bookkeeping dir directly.

\code{purgeCache()} is a deprecated alias.
}
