base-internal {base}R Documentation

Internal Functions in the Base Package

Description

Internal functions in the base package, which are only user-visible because of the special nature of the base name space.

Usage

.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)

Arguments

x object from which to extract elements.
package the name of a package.
lib.loc a character vector describing the location of R library trees to search through, or NULL. The default value of NULL corresponds to all libraries currently known.
quiet logical. Should this not give warnings or an error if the package(s) are not found?
useImports logical. Should the Imports field be processed?
verbose a logical. If TRUE, additional diagnostics are printed.
file The full path to the ‘DESCRIPTION’ file of a package.
quietly logical: should message(s) be printed.
pkginfo A processed ‘DESCRIPTION’ file of class "packageDescription2".
built, run platform strings of the form "cpu-vendor-os".
name name of image file to save or load.
x an object with a "row.names" attribute, typically a data frame.
type integer. Currently type = 0 returns the internal "row.names" attribute (possibly NULL), type = 2 the number of rows implied by the attribute, and type = 1 the latter with a negative sign for ‘automatic’ row names.
n integer. The number of rows.

Details

The functions .subset and .subset2 are essentially equivalent to the [ and [[ operators, except methods that 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 and hence do not allow missing values in their arguments.

.find.package returns the paths to the locations where the given packages can be found. If lib.loc is NULL, then then attached packages are searched before the libraries. If a package is found more than once, the first match is used. Unless quiet = TRUE a warning will be given about the named packages which are not found, and an error if none are. If 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 ‘DESCRIPTION’ file containing a valid version field. Where more than one versioned match is found to a unversioned name (and no exact match), the highest-numbered version is selected.

.path.package returns the paths from which the named packages were loaded, or if none were named, for all currently loaded packages. Unless 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 package must include the version number if versioned installs are used.

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

.getRequiredPackages is a wrapper to .getRequiredPackages2 using a ‘DESCRIPTION’ file.

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 ‘canonical’ "cpu-vendor-os" descriptions. The default function omits the vendor part and allows small mismatches elsewhere. Cognoscenti can replace this function in the base name space.

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

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

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 q() and allies, but reinforces the warning that it should not be called directly.

row.names can be stored internally in compact form. .set_row_names(n) generates that form for automatic row names of length n, to be assigned to attr(<a data frame>, "row.names"). .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 type.

.GenericArgsEnv and .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 .GenericArgsEnv and the remaining non-language-element primitives correspond to .ArgsEnv. See the ‘R Internals’ manual for further details. They are used by args and print.default and the QC functions codoc and checkS3methods.

Value

.find.package and .path.packages return a character vector of paths to installed packages.
.getRequiredPackages and .getRequiredPackages2 return invisible().
testPlatformEquivalence: TRUE or FALSE.


[Package base version 2.5.0 Index]