base-internal {base}R Documentation

Internal Objects in Package base

Description

Internal objects in the base package most of which are only user-visible because of the special nature of the base namespace.

Usage

.subset(x, ...)
.subset2(x, ...)

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

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

.primTrace(obj)
.primUntrace(obj)

.Date(xx, cl = "Date")
.POSIXct(xx, tz = NULL, cl = c("POSIXct", "POSIXt"))
.POSIXlt(xx, tz = NULL, cl = c("POSIXlt", "POSIXt"))
.difftime(xx, units, cl = "difftime")

.cache_class(class, extends)

.popath

.detach(pos)

.maskedMsg(same, pkg, by)

## Only on Windows:
.fixupGFortranStdout()
.fixupGFortranStderr()

.doWrap(vec, decr, nalast, noNA = NA) 
.doSortWrap(vec, decr, nalast, noNA = NA)

.amatch_bounds(x = 0.1) 
.amatch_costs(x = NULL)
.check_tzones(...)
.decode_numeric_version(x)
.encode_numeric_version(x) 
.make_numeric_version(x, strict = TRUE, regexp, classes = NULL) 
.expand_R_libs_env_var(x) 
.kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...) 
.packageStartupMessage(message, call = NULL) 
.rmpkg(pkg) 
.formula2varlist(formula, data, warnLHS = TRUE, ignoreLHS = warnLHS)

Arguments

x

an object

for .subset*():

from which to extract elements.

for .row_names_info():

with a "row.names" attribute, typically a data frame.

for .gt, .gtn:

typically S3- or S4-classed.

file
for .getRequiredPackages():

the full path to the ‘DESCRIPTION’ file of a package.

for lazyLoadDBfetch():

the filepath to a lazyload database.

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 to .libPaths().

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?

quietly

logical: should message(s) be printed.

pkgInfo

a processed ‘DESCRIPTION’ file of class "packageDescription2".

name

name of image file to save or load.

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.

info

character string such as "package:MASS".

key

the object name in a lazyload database.

compressed

logical: are the values in the database compressed?

hook

a load hook: see unserialize.

seed

a length-one integer vector.

i, j

indices.

strictly

logical.

obj

an R object.

xx

a classless object to be placed into the class.

tz

an optional time zone.

cl

an optional character vector of classes containing the default classes.

units

see difftime.

...

arguments passed to non-dot name versions.

pos

an integer.

same

character vector of same objects, masking others.

pkg

character string naming the package which is masked from or by.

by

logical indicating if the masking happens by pkg, or (by = FALSE) from pkg.

formula

typically a one sided formula, with no LHS.

data

a data frame where terms in the formula are to be evaluated.

warnLHS

logical flag, indicating whether the presence of an LHS should trigger a warning.

ignoreLHS

logical flag, indicating whether variables in the LHS should be ignored.

Details

The functions .subset and .subset2 are essentially equivalent to the [ and [[ 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.

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

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.

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

.TAOCP1997init is the initialization code for the "Knuth-TAOCP" RNG.

.gt and .gtn are callbacks from rank and is.unsorted used for (S3 or S4) classed objects.

.primTrace and .primUntrace are the primitive functions underlying trace and untrace respectively.

.Date, .POSIXct, .POSIXlt and .difftime are class generators.

.cache_class caches the inheritance of an S4 class for use in S3 method dispatch. With NULL second argument it returns the cached inheritance, for diagnostic use.

.popath is a character string created at startup which records where the translations package in use is, possibly NA_character_.

.detach is a ‘bare-bones’ version of detach for use in other R packages.

.maskedMsg is a utility called both from attach() and library() for consistency to produce the warning message.

Objects starting .C_ and .F_ are references to registered C and Fortran entry points.

Only on Windows:
.fixupGFortranStdout and .fixupGFortranStderr are helper functions to enable standard output and standard error units in gfortran when executing external code via system and system2. By default, these units are disabled by the Windows profile when running inside RGui.

Value

.getRequiredPackages and .getRequiredPackages2 return invisible().

.formula2varlist returns a list of variables found in formula, evaluated in data, following standard non-standard evaluation rules. Used in split and tapply to interpret a formula as a list of categorical variables to split on.


[Package base version 4.4.1 Index]