% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Require2.R
\name{trimRedundancies}
\alias{trimRedundancies}
\title{Collapse redundant package specifications}
\usage{
trimRedundancies(
  pkgInstall,
  repos = NULL,
  purge = NULL,
  libPaths = NULL,
  verbose = getOption("Require.verbose"),
  type = getOption("pkgType")
)
}
\arguments{
\item{pkgInstall}{Package specifications: a character vector, or a
\code{data.table} as produced internally by \code{Require}.}

\item{repos, purge, libPaths}{Unused; retained so existing positional calls
keep working.}

\item{verbose}{Numeric or logical, controlling messaging verbosity.}

\item{type}{Package type, as in \code{\link[utils:install.packages]{utils::install.packages()}}.}
}
\value{
A \code{data.table} with one row per package, with redundant entries
removed. Callers wanting the specifications back as text take the
\code{packageFullName} column.
}
\description{
Given package specifications that may name the same package more than once --
e.g. \code{"pkg"}, \code{"pkg (>= 1.0)"} and \code{"user/pkg@branch"} -- reduce them to one
entry per package, keeping the most specific requirement. This is the
reduction \code{Require()} applies to a dependency set before installing, exposed
because packages that assemble their own \code{reqdPkgs}-style lists need the same
rule to agree with what \code{Require()} will actually do.
}
\examples{
trimRedundancies(c("data.table", "data.table (>= 1.14.0)"))

}
\seealso{
Other version specifications:
\code{\link[=compareVersion2]{compareVersion2()}},
\code{\link[=extractPkgName]{extractPkgName()}},
\code{\link[=parseGitHub]{parseGitHub()}},
\code{\link[=trimVersionNumber]{trimVersionNumber()}}
}
\concept{version specifications}
