\HeaderA{base-internal}{Internal Functions in the Base Package}{base.Rdash.internal}
\aliasA{.ArgsEnv}{base-internal}{.ArgsEnv}
\aliasA{.find.package}{base-internal}{.find.package}
\aliasA{.GenericArgsEnv}{base-internal}{.GenericArgsEnv}
\aliasA{.getRequiredPackages}{base-internal}{.getRequiredPackages}
\aliasA{.getRequiredPackages2}{base-internal}{.getRequiredPackages2}
\aliasA{.gt}{base-internal}{.gt}
\aliasA{.gtn}{base-internal}{.gtn}
\aliasA{.isMethodsDispatchOn}{base-internal}{.isMethodsDispatchOn}
\aliasA{.path.package}{base-internal}{.path.package}
\aliasA{.row\_names\_info}{base-internal}{.row.Rul.names.Rul.info}
\aliasA{.set\_row\_names}{base-internal}{.set.Rul.row.Rul.names}
\aliasA{.subset}{base-internal}{.subset}
\aliasA{.subset2}{base-internal}{.subset2}
\aliasA{.TAOCP1997init}{base-internal}{.TAOCP1997init}
\aliasA{findPackageEnv}{base-internal}{findPackageEnv}
\aliasA{lazyLoadDBfetch}{base-internal}{lazyLoadDBfetch}
\aliasA{sys.load.image}{base-internal}{sys.load.image}
\aliasA{sys.save.image}{base-internal}{sys.save.image}
\aliasA{testPlatformEquivalence}{base-internal}{testPlatformEquivalence}
\keyword{internal}{base-internal}
\begin{Description}\relax
Internal functions in the base package, which are only user-visible
because of the special nature of the base name space.
\end{Description}
\begin{Usage}
\begin{verbatim}
.subset(x, ...)
.subset2(x, ...)

.find.package(package, lib.loc = NULL, quiet = FALSE,
              verbose = getOption("verbose"))

.path.package(package, quiet = FALSE)

.getRequiredPackages(file = "DESCRIPTION", quietly = FALSE,
                     useImports = FALSE)
.getRequiredPackages2(pkgInfo, quietly = FALSE, lib.loc = NULL,
                      useImports = FALSE)

testPlatformEquivalence(built, run)

.isMethodsDispatchOn(onOff = NULL)

sys.load.image(name, quiet)
sys.save.image(name)

.row_names_info(x, type = 1L)
.set_row_names(n)

findPackageEnv(info)

lazyLoadDBfetch(key, file, compressed, hook)

.TAOCP1997init(seed)

.gt(x, i, j)

.gtn(x, strictly)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] object from which to extract elements.
\item[\code{package}] the name of a package.
\item[\code{lib.loc}] a character vector describing the location of \R{}
library trees to search through, or \code{NULL}.  The default value
of \code{NULL} corresponds to all libraries currently known.
\item[\code{quiet}] logical.  Should this not give warnings or an error
if the package(s) are not found?
\item[\code{useImports}] logical.  Should  the \code{Imports} field be processed?
\item[\code{verbose}] a logical.  If \code{TRUE}, additional diagnostics are
printed.
\item[\code{file}] The full path to the \file{DESCRIPTION} file of a package.
\item[\code{quietly}] logical: should message(s) be printed.
\item[\code{pkginfo}] A processed \file{DESCRIPTION} file of class
\code{"packageDescription2"}.
\item[\code{built, run}] platform strings of the form \code{"cpu-vendor-os"}.
\item[\code{name}] name of image file to save or load.
\item[\code{x}] an object with a \code{"row.names"} attribute, typically a
data frame.
\item[\code{type}] integer. Currently \code{type = 0} returns the internal
\code{"row.names"} attribute (possibly \code{NULL}), \code{type = 2}
the number of rows implied by the attribute, and \code{type = 1} the
latter with a negative sign for \sQuote{automatic} row names.
\item[\code{n}] integer.  The number of rows.
\item[\code{info}] character string such as \code{"package:MASS"}.
\item[\code{key}] the object name in a lazyload database.
\item[\code{file}] the filepath to a lazyload database.
\item[\code{compressed}] logical: are the values in the database compressed?
\item[\code{refhook}] a load hook: see \code{\LinkA{unserialize}{unserialize}}.
\item[\code{seed}] a length-one integer vector.
\item[\code{i, j}] indices.
\item[\code{strictly}] logical.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The functions \code{.subset} and \code{.subset2} are essentially
equivalent to the \code{\LinkA{[}{[}} and \code{\LinkA{[[}{[[}} operators,
except that methods dispatch does not take place.  This is to avoid
expensive unclassing when applying the default method to an object.  They
should not normally be invoked by end users.  Note that unlike the
operators they are builtins and not specials (all arguments are
evaluated) and hence do not allow missing arguments.

\code{.find.package} returns the paths to the locations where the
given packages can be found.  If \code{lib.loc} is \code{NULL}, then
then attached packages are searched before the libraries.  If a
package is found more than once, the first match is used.  Unless
\code{quiet = TRUE} a warning will be given about the named packages
which are not found, and an error if none are.  If \code{verbose} is
true, warnings about packages found more than once are given.  It does
know about versioned installs of packages, and for a package to be
returned it must have a \file{DESCRIPTION} file containing a valid
\code{version} field.  Where more than one versioned match is found to
a unversioned name (and no exact match), the highest-numbered version
is selected.

\code{.path.package} returns the paths from which the named packages
were loaded, or if none were named, for all currently loaded packages.
Unless \code{quiet = TRUE} it will warn if some of the packages named
are not loaded, and given an error if none are.  This function is not
meant to be called by users, and its interface might change in future
versions.  Note that currently \code{package} must include the
version number if versioned installs are used.

\code{.getRequiredPackages2} attaches all the packages mentioned in the
\code{Depends} field: failure to find a package is an error.  It also
checks the versions of the packages found against the \code{Depends} field.

\code{.getRequiredPackages} is a wrapper to
\code{.getRequiredPackages2} using a \file{DESCRIPTION} file.

\code{testPlatformEquivalence} is used to test if a package with 
compiled code can safely be loaded into a build of \R, which it does by
comparing their \sQuote{canonical} \code{"cpu-vendor-os"} descriptions.
The default function omits the \code{vendor} part and allows small 
mismatches elsewhere.  Cognoscenti can replace this function in the
\code{base} name space.

The function \code{.isMethodsDispatchOn()} returns \code{TRUE} if
the S4 method dispatch has been turned on in the evaluator (usually by
loading package \pkg{methods}).  It is meant for \R{} internal use only.

\code{sys.save.image} is a system function that is called by \code{q()}
and its GUI analogs; \code{sys.load.image} is called by the startup code.
These functions should not be called directly and are subject to change.

\code{sys.save.image} closes all connections first, to ensure that it
is able to open a connection to save the image.  This is appropriate
when called from \code{q()} and allies, but reinforces the warning
that it should not be called directly.

\code{\LinkA{row.names}{row.names}} can be stored internally in compact form.
\code{.set\_row\_names(n)} generates that form for automatic row names
of length \code{n}, to be assigned to
\code{attr(<a data frame>, "row.names")}.  \code{.row\_names\_info}
gives information on the internal form of the row names for a data
frame: for details of what information see the argument \code{type}.

\code{.GenericArgsEnv} and \code{.ArgsEnv} are environments that
contain closures with the argument lists that the primitives would
have had had they been closures.  All the primitives that are internal
S3 generics have corresponding members of \code{.GenericArgsEnv} and
the remaining non-language-element primitives correspond to
\code{.ArgsEnv}. See the \sQuote{R Internals} manual for further
details.  They are used by \code{\LinkA{args}{args}} and
\code{\LinkA{print.default}{print.default}} and the QC functions \code{\LinkA{codoc}{codoc}}
and \code{\LinkA{checkS3methods}{checkS3methods}}.

\code{findPackageEnv} is invoked by the unserialize code to set a
saved environment if possible.

\code{.TAOCP1997init} is the initialization code for the
\code{"Knuth-TAOCP"} \LinkA{RNG}{RNG}.

\code{.gt} and \code{.gtn} are callbacks from \code{\LinkA{rank}{rank}} and
\code{\LinkA{is.unsorted}{is.unsorted}} used for classed objects.
\end{Details}
\begin{Value}
\code{.find.package} and \code{.path.packages} return a character
vector of paths to installed packages.

\code{.getRequiredPackages} and \code{.getRequiredPackages2}
return \code{invisible()}.

\code{testPlatformEquivalence}: \code{TRUE} or \code{FALSE}.
\end{Value}

