% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/libraries.r
\name{libraries}
\alias{libraries}
\alias{requires}
\title{Loading/Attaching Multiple Packages}
\usage{
libraries(
  ...,
  pos = 2,
  lib.loc = NULL,
  character.only = FALSE,
  logical.return = FALSE,
  warn.conflicts,
  quietly = FALSE,
  verbose = getOption("verbose"),
  mask.ok,
  exclude,
  include.only,
  attach.required = missing(include.only)
)

requires(
  ...,
  lib.loc = NULL,
  quietly = FALSE,
  warn.conflicts,
  character.only = FALSE,
  mask.ok,
  exclude,
  include.only,
  attach.required = missing(include.only)
)
}
\arguments{
\item{...}{the names of the packages, given as \link{name}s, character strings,
a combination of both, or character vectors (see \code{character.only}
below).}

\item{pos}{the position on the search list at which to attach the loaded
namespace. Can also be the name of a position on the current
search list as given by \code{\link[=search]{search()}}.}

\item{lib.loc}{a character vector describing the location of \strong{R} library trees to
search through, or \code{NULL}. The default value of \code{NULL} corresponds
to all libraries currently known to \code{\link[=.libPaths]{.libPaths()}}. Non-existent
library trees are silently ignored.}

\item{character.only}{a logical indicating whether package or help can be assumed to be
character strings. If \code{TRUE}, dot arguments are coerced to be
character before being unlisted into a single character vector.}

\item{logical.return}{logical. If it is \code{TRUE}, \code{FALSE} or \code{TRUE} is returned to indicate
success.}

\item{warn.conflicts}{logical. If \code{TRUE}, warnings are printed about \link{conflicts} from
attaching the new package. A conflict is a function masking a
function, or a non-function masking a non-function. The default
is \code{TRUE} unless specified as \code{FALSE} in the \code{conflicts.policy} option.}

\item{quietly}{a logical. If \code{TRUE}, no message confirming package attaching
is printed, and most often, no errors/warnings are printed
if package attaching fails.}

\item{verbose}{a logical. If \code{TRUE}, additional diagnostics are printed.}

\item{mask.ok}{character vector of names of objects that can mask objects on the
search path without signaling an error when strict conflict checking
is enabled.}

\item{exclude, include.only}{character vector of names of objects to exclude or include in the
attached frame. Only one of these arguments may be used in a
call to \code{libraries} or \code{requires}.}

\item{attach.required}{logical specifying whether required packages listed in the
\code{Depends} clause of the \code{DESCRIPTION} file should be attached
automatically.}
}
\value{
\code{libraries()} and \code{requires()} return the value of the last
dot argument evaluated, invisibly:

Normally \code{library} returns (invisibly) the list of attached
packages, but \code{TRUE} or \code{FALSE} if \code{logical.return} is \code{TRUE}.
When called as \code{library()} it returns an object of class
\code{"libraryIQR"}, and for \code{library(help=)}, one of class
\code{"packageInfo"}.

\code{require} returns (invisibly) a logical indicating whether the
required package is available.
}
\description{
Wraps \code{\link[=library]{library()}} and \code{\link[=require]{require()}} to
load multiple packages.
}
\details{
All non-dot arguments are passed in their entirety to
each \code{library} or \code{require} call, so the same arguments are
used for each package.

For the \code{help} of a package, call \verb{library(help = <package>)}
directly.

For full details see \link{library}.
}
\examples{
libraries("stats", "graphics", methods)
requires("stats", graphics, "methods")

x <- c("stats", "graphics")
libraries(x, "methods", character.only = TRUE)
try(requires(methods, x, character.only = TRUE))
}
\seealso{
\link{attach}, \link{detach}, \link{install.packages}
}
