Appendix: R Reference - R in a Nutshell
Pages: 1, 2, 3, 4, 5

base

This package contains the basic functions that let Rfunction as a language: arithmetic, input/output, basic programmingsupport, and so on. Its contents are available through inheritance fromany environment.

Functions

FunctionDescription
!Not operator.
!=Not equal operator.
$, $<-Select or set named element from a list.
%%Modulo operator.
%*%Binary operator to multiply two matrices, ifthey are conformable.
%/%Integer division operator.
%in%Binary operator that returns a logical vectorindicating if there is a match or not for its left operand.
%o%Operator to calculate the outer product of twoarrays.
%x%Operator to calculate the Kronecker product oftwo arrays.
&Operator that performs elementwise logicalAND.
&&Operator that performs logical AND, evaluatingexpressions from left to right until the result isdetermined.
*Multiplication operator.
+Addition operator.
-Unary negation or binary subtractionoperator.
/Binary division operator.
:Generates regular sequences.
::Accesses an exported variable in anamespace.
:::Accesses an internal variable in a namespace.
<Less-than operator.
>Greater-than operator.
>=Greater-than-or-equal-to operator.
<=Less-than-or-equal-to operator.
==Equality operator.
@Extracts the contents of an slot in an objectwith a formal (S4) class structure.
ArgReturns argument of a complex value.
ConjReturns conjugate of a complex value.
Cstack_infoReports information on the C stack size and usage (ifavailable).
Encoding, Encoding<-Read or set the declared encodings for a charactervector.
FilterExtracts the elements of a vector for which a predicate(logical) function gives true.
FindReturns the first or last element in a vector for whicha condition is true.
IChanges the class of an object to indicate that itshould be treated "as is."
ISOdate, ISOdatetimeFunctions to convert between character representationsand objects of classes "POSIXlt" and "POSIXct" representing calendardates and times.
ImExtracts the imaginary part of a complex value.
La.svdComputes the singular-value decomposition of arectangular matrix.
MapApplies a function to the corresponding elements ofgiven vectors.
ModReturns the modulus of a complex number.
NCOL, NROWnrow and ncol return the number of rows orcolumns present in x.NCOL and NROW do the same, treating a vectoras one-column matrix.
NegateCreates the negation of a given function.
NextMethodFor S3 generic functions, dispatches to the method forthe next class in the object's class vector.
PositionGives the position of an element in a matrix for whicha predicate (logical) function is true.
R.VersionProvides detailed information about the version of Rrunning.
R.homeReturns the R home directory.
RNGkindAllows you to query or set the kind of random numbergenerator (RNG) in use.
RNGversionCan be used to set the random number generators as theywere in an earlier R version (for reproducibility).
R_system_versionSimple S3 class for representing numeric versions, including package versions, and associated methods.
ReReturns the real part of a complex number.
RecallUsed as a placeholder for the name of the function inwhich it is called. It allows the definition of recursivefunctions that still work after being renamed.
ReduceUses a binary function to successively combine theelements of a given vector and a possibly given initialvalue.
Sys.Date, Sys.timeReturn the system's idea of the current date with andwithout time.
Sys.chmodProvides a low-level interface to the computer's filesystem.
Sys.getenvObtains the values of the environmentvariables.
Sys.getlocaleGets details of or sets aspects of the locale for the Rprocess.
Sys.getpidGets the process ID of the R session.
Sys.globPerforms wildcard expansion (also known as "globbing")on file paths.
Sys.infoReports system and user information.
Sys.localeconvGets details of the numerical and monetaryrepresentations in the current locale.
Sys.setenvSets environment variables (for other processes calledfrom within R or future calls to Sys.getenv from this Rprocess).
Sys.setlocaleGets details of or sets aspects of the locale for the Rprocess.
Sys.sleepSuspends execution of R expressions for a given numberof seconds.
Sys.timezoneReturns the current time zone.
Sys.umaskProvides a low-level interface to the computer's filesystem.
Sys.unsetenvRemoves environment variables.
Sys.whichInterface to the system command which.
UseMethodDispatches to the appropriate method for an S3 genericfunction.
VectorizeReturns a new function that acts as if mapply was called.
^Exponentiation operator.
abbreviateAbbreviates strings to at least minlength characters, such that theyremain unique (if they were), unlessstrict=TRUE.
absAbsolute value.
acosComputes the arccosine.
acoshComputes the hyperbolic arccosine.
addNAModifies a factor by turning NA into an extra level (sothat NA values are counted in tables, for instance).
addTaskCallbackRegisters an R function that is to be called each timea top-level task is completed.
agrepSearches for approximate matches to pattern (the first argument) withinthe string x (the secondargument) using the Levenshtein edit distance.
alistFunction to construct, coerce, and check for both kindsof R lists.
allGiven a set of logical vectors, are all of the valuestrue?
all.equalall.equal(x, y) is autility to compare R objects x and y testing "near equality." If theyare different, comparison is still made to some extent, and areport of the differences is returned.
all.names, all.varsReturn a character vector containing all the names thatoccur in an expression or call.
anyGiven a set of logical vectors, is at least one of thevalues true?
anyDuplicatedDetermines which elements of a vector or data frame areduplicates of elements with smaller subscripts and returns alogical vector indicating which elements (rows) areduplicates.
apermTransposes an array by permuting its dimensions andoptionally resizing it.
appendAdds elements to a vector.
applyReturns a vector or array or list of values obtained byapplying a function to margins of an array.
argsDisplays the argument names and corresponding defaultvalues of a function or primitive.
arrayCreates arrays.
as.DateFunction to convert between character representationsand objects of class "Date"representing calendar dates.
as.POSIXct, as.POSIXltFunctions to manipulate objects of classes "POSIXlt" and "POSIXct" representing calendardates and times.
as.arrayCoerces to arrays.
as.callCoerces to "call" objects.
as.characterCoerces to "character" objects.
as.complexCoerces to "complex" objects.
as.data.frameCoerces to "data.frame" objects.
as.difftimeCoerces to "difftime" objects.
as.doubleCoerces to "double" objects.
as.environmentConverts a number or a character string to thecorresponding environment on the search path.
as.expressionCoerces to "expression" objects.
as.factorCoerces to "factor".
as.functionCoerces to "function".
as.hexmodeCoerces to "hexmode".
as.integerCreates or tests for objects of type "integer".
as.listCoerces to "list".
as.logicalCoerces to "logical" objects.
as.matrixCoerces to "matrix" objects.
as.nameCoerces to "name" objects.
as.nullIgnores its argument and returns the value NULL.
as.numericCoerces to "numeric".
as.numeric_versionCoerces to "numeric_version".
as.octmodeCoerces to "octmode".
as.orderedCoerces to ordered factors.
as.package_versionCoerces to "package_version" object.
as.pairlistCoerces to "pairlist" object.
as.rawCoerces to type "raw".
as.realCoerces to type "real".
as.symbolCoerces to "symbol".
as.tableCoerces to "table".
as.vectorCoerces to "vector".
asS4Tests whether the object is an instance of an S4class.
asinComputes the arcsine.
asinhComputes the hyperbolic arcsine.
assignAssigns a value to a name in an environment.
atanComputes the arctangent.
atan2Computes the two-argument arctangent.
atanhComputes the hyperbolic arctangent.
attachAttaches a database (usually a list, data frame, orenvironment) to the R search path. This means that thedatabase is searched by R when evaluating a variable, soobjects in the database can be accessed by simply giving theirnames.
attachNamespaceFunction to load and unload namespaces.
attr, attr<-Get or set specific attributes of an object.
attributes, attributes<-Access an object's attributes.
autoload, autoloaderautoload creates apromise-to-evaluate autoloader and stores it with namename in the.AutoloadEnv environment.
backsolveSolves a system of linear equations where thecoefficient matrix is upper or lower triangular.
baseenvGets, sets, tests for, and createsenvironments.
basenameRemoves all of the path up to the last path separator(if any).
besselI, besselJ, besselK, besselYBessel functions of integer and fractional order, offirst and second kind, J(υ) andY(υ), and modifiedBessel functions (of first and third kind), I(υ) andK(υ).
betaSpecial mathematical function related to the beta andgamma functions.
bindingIsActive, bindingIsLockedThese functions represent an experimental interface foradjustments to environments and bindings within environments.They allow for locking environments as well as individualbindings and for linking a variable to a function.
bindtextdomainIf Native Language Support was enabled in this build ofR, attempts to translate character vectors or sets where thetranslations are to be found.
body, body<-Get or set the body of a function.
bquoteAnalog of the LISP backquote, macro. bquote quotes its argument exceptthat terms wrapped in .()are evaluated in the specified where environment.
breakBasic control-flow constructs of the R language. Theyfunction in much the same way as control statements in anyAlgol-like language. They are all reserved words.
browserInterrupts the execution of an expression and allowsthe inspection of the environment where browser was called from.
builtinsReturns the names of all the built-in objects. Theseare fetched directly from the symbol table of the Rinterpreter.
byAn object-oriented wrapper for tapply applied to dataframes.
bzfileFunction to create, open, and closeconnections.
cCombines its arguments.
callCreates or tests for objects of mode "call".
callCCDownward-only version of Scheme's call with currentcontinuation.
capabilitiesReports on the optional features that have beencompiled into this build of R.
casefoldTranslates characters in character vectors, inparticular, from upper- to lowercase or vice versa.
catOutputs the objects, concatenating the representations.cat performs much lessconversion than print.
cbindTakes a sequence of vector, matrix, or data framearguments and combines by columns.
ceilingTakes a single numeric argument x and returns a numeric vectorcontaining the smallest integers not less than thecorresponding elements of x.
char.expandSeeks a unique match of its first argument among theelements of its second. If successful, it returns thiselement; otherwise, it performs an action specified by thethird argument.
charToRawConversion and manipulation of objects of type"raw".
characterCreates or tests for objects of type"character".
charmatchSeeks matches for the elements of its first argumentamong those of its second.
chartrTranslates characters in character vectors, inparticular, from upper- to lowercase or vice versa.
check_tzonesDescription of the classes "POSIXlt" and "POSIXct" representing calendardates and times (to the nearest second).
cholComputes the Choleski factorization of a real, symmetric, positive-definite square matrix.
chol2invInverts a symmetric, positive-definite square matrixfrom its Choleski decomposition. Equivalently, computes(X'X)-1 fromthe (R part) of theQR-decomposition ofX.
chooseSpecial mathematical function related to the beta andgamma functions.
class, class<-The function classprints the vector of names of classes an object inherits from.Correspondingly, class<-sets the classes an object inherits from.
close, close.connectionClose connections.
closeAllConnectionsDisplays aspects of connections.
colReturns a matrix of integers, indicating their columnnumber in a matrix-like object or a factor of columnlabels.
colMeansForms row and column means for numeric arrays.
colSumsForms row and column sums for numeric arrays.
colnames, colnames<-Retrieve or set the row or column names of amatrix-like object.
commandArgsProvides access to a copy of the command-line argumentssupplied when this R session was invoked.
comment, comment<-Set and query a comment attributefor any R objects.
computeRestartsProvides a mechanism for handling unusual conditions, including errors and warnings.
conditionCall, conditionCall.condition, conditionMessage, conditionMessage.conditionProvide a mechanism for handling unusual conditions, including errors and warnings.
conflictsReports on objects that exist with the same name in twoor more places on the search path, usually because anobject in the user's workspace or a package is masking asystem object of the same name. This helps discoverunintentional masking.
contributorsThe R Who's Who, describing who made significantcontributions to the development of R.
crossprodGiven matrices x andy as arguments, returns amatrix cross-product. This is formally equivalent to (butusually slightly faster than) the call t(x) \%*\% y.
cummax, cummin, cumprod, cumsumReturns a vector whose elements are the cumulativesums, products, minima, or maxima of the elements of theargument.
cutDivides the range of x into intervals and codes thevalues in x according towhich interval they fall. The leftmost interval corresponds tolevel 1, the next leftmost to level 2 and so on.
cut.Date, cut.POSIXtMethod for cutapplied to date-time objects.
dQuoteSingle- or double-quote text by combining withappropriate single or double left and right quotationmarks.
data.classDetermines the class of an arbitrary R object.
data.frameCreates data frames.
data.matrixReturns the matrix obtained by converting all thevariables in a data frame to numeric mode and then bindingthem together as the columns of a matrix. Factors and orderedfactors are replaced by their internal codes.
dateReturns a character string of the current system dateand time.
debugSets, unsets, or queries the debugging flag on afunction.
default.stringsAsFactorsCreates data frames, tightly coupled collections ofvariables that share many of the properties of matrices andlists, used as the fundamental data structure by most of R'smodeling software.
delayedAssignCreates a promise to evaluate agiven expression if its value is requested. This providesdirect access to the lazy evaluationmechanism used by R for the evaluation of (interpreted)functions.
deparseTurns unevaluated expressions into characterstrings.
det, determinantdet calculates thedeterminant of a matrix. determinant is a generic functionthat returns separately the modulus of the determinant, optionally on the logarithm scale, and the sign of thedeterminant.
detachDetaches a database, i.e., removes it from the search() path of available Robjects. Usually, this is either a data.frame that has been attached or a package that wasrequired previously.
dgetWrites an ASCII (American Standard Code for InformationInterchange) text representation of an R object to a file orconnection or uses one to re-create the object.
diag, diag<-Extract or replace the diagonal of a matrix orconstruct a diagonal matrix.
diff, diff.Date, diff.POSIXt, diff.defaultReturn suitably lagged and iterateddifferences.
difftimeCreates, prints, and rounds time intervals.
digammaSpecial mathematical function related to the beta andgamma functions.
dim, dim.data.frame, dim<-, dimnames, dimnames.data.frame, dimnames<-, dimnames<-.data.frameRetrieve or set the dimension of an object.
dir, dir.createProduce a character vector of the names of files in thenamed directory.
dirnameReturns the part of the path up to (but excluding) the lastpath separator, or "." ifthere is no path separator.
do.callConstructs and executes a function call from a name ora function and a list of arguments to be passed to it.
doubleCreates, coerces to, or tests for a double-precisionvector.
dputWrites an ASCII text representation of an R object to afile or connection or uses one to re-create theobject.
dropDeletes the dimensions of an array that has only onelevel.
dumpTakes a vector of names of R objects and produces textrepresentations of the objects on a file or connection. Adump file can usually besourced into another R (orS) session.
duplicatedDetermines which elements of a vector or data frame areduplicates of elements with smaller subscripts and returns alogical vector indicating which elements (rows) areduplicates.
dyn.load, dyn.unloadLoad or unload DLLs (also known as shared objects) andtest whether a C function or FORTRAN subroutine isavailable.
eapplyApplies FUN to thenamed values from an environment and returns the results as alist.
eigenComputes eigenvalues and eigenvectors of real orcomplex matrices.
emptyenvGets, sets, tests for, and createsenvironments.
encodeStringEscapes the strings in a character vector in the sameway print.default does andoptionally fits theencoded strings within a field width.
env.profileThis function is intended to assess the performance ofhashed environments.
environment, environment<-Gets or sets the environment associated with a functionor formula.
environmentIsLockedReturns a logical environment indicating if anenvironment is locked.
environmentNameReturns the name of an environment.
eval, eval.parent, evalqEvaluate an R expression in a specifiedenvironment.
existsLooks for an R object of a given name.
expComputes the exponential function.
expand.gridCreates a data frame from all combinations of thesupplied vectors or factors.
expm1Computesex − 1accurately for x << 1.
expressionCreates objects of mode "expression".
factorUsed to encode a vector as a factor.
factorialSpecial mathematical function related to the beta andgamma functions.
fifoCreates a FIFO connection.
fileCreates a file connection.
file.accessUtility function to access information about files onthe user's file systems.
file.appendProvides a low-level interface to the computer's filesystem.
file.chooseChooses a file interactively.
file.copy, file.create, file.existsProvide a low-level interface to the computer's filesystem.
file.infoUtility function to extract information about files onthe user's file systems.
file.pathConstructs the path to a file from components in aplatform-independent way.
file.remove, file.renameProvides a low-level interface to the computer's filesystem.
file.showDisplays one or more files.
file.symlinkProvides a low-level interface to the computer's filesystem.
findIntervalFinds the indices of x in vec, where vec must be sorted(nondecreasingly).
findRestartProvides a mechanism for handling unusual conditions, including errors and warnings.
floorTakes a single numeric argument x and returns a numeric vectorcontaining the largest integers not greater than thecorresponding elements of x.
flush, flush.connectionFunctions to create, open, and closeconnections.
forceForces the evaluation of a function argument.
formals, formals<-Get or set the formal arguments of a function.
format, format.AsIsFormat an R object for pretty printing.
formatCFormats numbers individually and flexibly, usingC-style formatspecifications.
formatDLFormats vectors of items and their descriptions astwo-column tables or LaTeX-style description lists.
forwardsolveSolves a system of linear equations where thecoefficient matrix is upper or lower triangular.
functionProvides the base mechanisms for defining new functionsin the R language.
gammaSpecial mathematical function related to the beta andgamma functions.
gcCauses garbage collection to take place.
gc.timeReports the time spent in garbage collection so far inthe R session while GC timing was enabled.
gcinfoSets a flag so that automatic collection is eithersilent (verbose=FALSE) orprints memory usage statistics (verbose=TRUE).
gctortureProvokes garbage collection on (nearly) every memoryallocation. Intended to ferret out memory protection bugs.Also makes R run very slowly, unfortunately.
getSearches for an R object with a given name and returnsit.
getAllConnectionsDisplays aspects of connections.
getCConverterDescriptions, getCConverterStatusProvide facilities to manage the extensible list ofconverters used to translate R objects into C pointers for usein .C calls. The number anda description of each element in the list can be retrieved.One can also query and set the activity status of individualelements, temporarily ignoring them. And one can removeindividual elements.
getConnectionDisplays aspects of connections.
getDLLRegisteredRoutines, getDLLRegisteredRoutines.DLLInfo, getDLLRegisteredRoutines.characterThese functions allow us to query the set of routinesin a DLL that are registered with R to enhance dynamic lookup, error handling when calling native routines, and potentiallysecurity in the future. These functions provide a descriptionof each of the registered routines in the DLL for thedifferent interfaces, i.e., .C, .Call, .Fortran, and .External.
getExportedValueFunction to support reflection on namespaceobjects.
getHookAllows users to set actions to be taken before packagesare attached/detached and namespaces are (un)loaded.
getLoadedDLLsProvides a way to get a list of all the DLLs (seedyn.load) that arecurrently loaded in the R session.
getNamespace, getNamespaceExports, getNamespaceImports, getNamespaceName, getNamespaceUsers, getNamespaceVersionFunctions to support reflection on namespaceobjects.
getNativeSymbolInfoFinds and returns as comprehensive a description of oneor more dynamically loaded or "exported" built-in nativesymbols.
getNumCConvertersUsed to manage the extensible list of converters usedto translate R objects into C pointers for use in .C calls. Returns an integer givingthe number of elements in a specified list, both active andinactive.
getOptionAllows the user to set and examine a variety of globaloptions that affect the way in which Rcomputes and displays its results.
getRversionA simple S3 class for representing numeric versions, including package versions, and associated methods.
getSrcLinesThis function is for working with source files.
getTaskCallbackNamesProvides a way to get the names (or identifiers) forthe currently registered task callbacks that are invoked atthe conclusion of each top-level task. These identifiers canbe used to remove a callback.
geterrmessageGives the last error message.
gettextIf Native Language Support was enabled in this build ofR, attempts to translate character vectors or set where thetranslations are to be found.
gettextfA wrapper for the C function sprintf that returns a charactervector containing a formatted combination of text and variablevalues.
getwdReturns an absolute filename representing the currentworking directory of the R process.
glGenerates factors by specifying the pattern of theirlevels.
globalenvGets, sets, tests for, and createsenvironments.
gregexpr, grep, grepl, gsubgrep searches formatches to pattern (itsfirst argument) within the character vector x (second argument). grepl is an alternative way toreturn the results. regexprand gregexpr return results, too, but they return more detail in a differentformat.
gsubsub and gsub perform replacement of matchesdetermined by regular expression matching.
gzconProvides a modified connection that wraps an existingconnection and decompresses reads or compresses writes throughthat connection. Standard gzip headers are assumed.
gzfileFunction to create, open, and closeconnections.
iconv, iconvlistThese use system facilities to convert a charactervector between encodings: the "i" stands for"internationalization."
icuSetCollateControls the way collation is done by ICU (an optionalpart of the R build).
identicalThe safe and reliable way to test two objects for beingexactly equal. It returns TRUE in this case, FALSE in every other case.
identityA trivial identity function returning itsargument.
ifelseReturns a value with the same shape as test that is filled with elementsselected from either yes orno, depending on whetherthe element of test isTRUE or FALSE.
inheritsIndicates whether its first argument inherits from anyof the classes specified in the what argument.
intToBitsConversion and manipulation of objects of type "raw".
intToUtf8Conversion of UTF-8 encoded character vectors to andfrom integer vectors.
integerCreates or tests for objects of type "integer".
interactionComputes a factor that represents the interaction ofthe given factors. The result of interaction is alwaysunordered.
interactiveReturns TRUE when Ris being used interactively and FALSE otherwise.
intersectPerforms set union, intersection, (asymmetric!) difference, equality, and membership on twovectors.
inverse.rleComputes the lengths and values of runs of equal valuesin a vector—or the reverse operation.
invisibleReturns a (temporarily) invisible copy of anobject.
invokeRestart, invokeRestartInteractivelyProvide a mechanism for handling unusual conditions, including errors and warnings.
is.RTests if running under R.
is.arrayCreates or tests for arrays.
is.atomicReturns TRUE ifx is an atomic vector (orNULL) and FALSE otherwise.
is.callTests for objects of mode "call".
is.characterTests for objects of type "character".
is.complexTests for objects of type "complex".
is.data.frameTests if an object is a data frame.
is.doubleTests for a double-precision vector.
is.elementTests if an element is a member of a set.
is.environmentTests if an object is an environment.
is.expressionTests if an object is an "expression".
is.factorReturns a logical value indicating if an object is afactor.
is.finite, is.infiniteReturn a vector of the same length as x, indicating which elements arefinite (not infinite and not missing).
is.functionChecks whether its argument is a (primitive)function.
is.integerCreates or tests for objects of type "integer".
is.languageReturns TRUE ifx is a variable name, a call, or an expression.
is.listTests if an object is a list.
is.loadedTests whether a C function or FORTRAN subroutine isavailable.
is.logicalTests for objects of type "logical".
is.matrixTests if its argument is a (strict) matrix.
is.na, is.na<-The generic function is.na indicates which elements in anobject are missing. The generic function is.na<- sets elements to NA.
is.nameReturns TRUE orFALSE, depending on whetherthe argument is a name or not.
is.nanTests if an object is a NaN (meaning "not anumber").
is.nullReturns TRUE if itsargument is NULL andFALSE otherwise.
is.numeric, is.numeric.Date, is.numeric.POSIXtA general test of an object being interpretable asnumbers.
is.numeric_versionA simple S3 class for representing numeric versions, including package versions, and associated methods.
is.orderedTests if an object is an ordered factor.
is.package_versionTests for a package_version object.
is.pairlistTests for a pairlist object.
is.primitiveChecks whether its argument is a (primitive)function.
is.qrTests whether an object is theQR-decomposition of a matrix (created bythe qr function).
is.rawTests for objects of type "raw".
is.recursiveReturns TRUE ifx has a recursive(listlike) structure and FALSE otherwise.
is.symbolis.symbol (and theidentical is.name) returnsTRUE or FALSE, depending on whether theargument is a name or not.
is.tabletable uses thecross-classifying factors to build a contingency table of thecounts at each combination of factor levels.
is.unsortedTests if an object is not sorted, without the cost ofsorting it.
is.vectorReturns TRUE ifx is a vector (of modelogical, integer, real, complex, character, raw or a list ifnot specified) or expression and FALSE otherwise.
isIncomplete, isOpenFunctions to create, open, and closeconnections.
isRestartProvides a mechanism for handling unusual conditions, including errors and warnings.
isS4Tests whether the object is an instance of an S4class.
isSeekableFunction to reposition connections.
isSymmetric, isSymmetric.matrixGeneric functions to test if object is symmetric or not.Currently, only a matrix method is implemented.
isTRUEThis operator acts on logical vectors.
isdebuggedSets, unsets, or queries the debugging flag on afunction.
jitterAdds a small amount of noise to a numericvector.
julian, julian.Date, julian.POSIXtExtract the weekday, month, or quarter, or the Juliantime (days since some origin). These are generic functions:the methods for the internal date-time classes are documentedhere.
kappa, kappa.defaultm, kappa.lm, kappa.qr, kappa.triThe condition number of a regular (square) matrix isthe product of the norm of the matrix and the norm of itsinverse (or pseudoinverse) and hence depends on the kind ofmatrix norm. kappa()computes an estimate of the 2-norm condition number of amatrix or of the R matrix of aQR-decomposition, perhaps of a linearfit. The 2-norm condition number can be shown to be the ratioof the largest to the smallest nonzerosingular value of the matrix.
kroneckerComputes the generalized Kronecker product of twoarrays, X and Y. \%x\% is an alias for kronecker (where FUN is hardwired to "*").
l10n_infoReports on localization information.
labelsFinds a suitable set of labels from an object for usein printing or plotting, for example.
lapplyReturns a list of the same length as X, each element of which is theresult of applying FUN tothe corresponding element of X.
lazyLoadLazy loads a database of R objects.
lbeta, lchooseSpecial mathematical functions related to the beta andgamma functions.
length, length<-, length<-.factorGet or set the length of vectors (including lists) andfactors and of any other R object for which a method has beendefined.
levels, levels.default, levels<-, levels<-.factorProvide access to the levels attribute of avariable.
lfactorial, lgammaSpecial mathematical functions related to the beta andgamma functions.
librarylibrary and require load add-onpackages.
library.dynamLoads a specified file of compiled code if it has notbeen loaded already, or unloads it.
library.dynam.unloadLoads a specified file of compiled code if it has notbeen loaded already, or unloads it.
licenceThe license terms under which R is distributed.
listFunction to construct, coerce, and check for both kindsof R lists.
list.filesProduces a character vector of the names of files inthe named directory.
loadReloads data sets written with the function save.
loadNamespaceLoads the specified namespace and registers it in aninternal database.
loadedNamespacesReturns a character vector of the names of the loadednamespaces.
loadingNamespaceInfoReturns a list of the arguments that would be passed to.onLoad when a namespace is being loaded.
localEvaluates an R expression in a specifiedenvironment.
lockBindingLocks individual bindings in a specifiedenvironment.
lockEnvironmentLocks its environment argument, which must be a normalenvironment (not base).
logComputes logarithms, by default naturallogarithms.
log10Computes common (i.e., base 10) logarithms.
log1pComputes log(1 + x) accurately for|x| << 1 (and less accurately whenx ≈ −1).
log2Computes binary (i.e., base 2) logarithms.
logicalCreates or tests for objects of type "logical" and the basic logicalconstants.
lower.triReturns a matrix of logicals the same size of a givenmatrix with entries TRUE inthe lower or upper triangle.
lsls and objects return a vector of characterstrings giving the names of the objects in a specifiedenvironment.
make.namesMakes syntactically valid names out of charactervectors.
make.uniqueMakes the elements of a character vector unique byappending sequence numbers to duplicates.
makeActiveBindingInstalls fun so that getting the value of sym calls funwith no arguments, and assigning to sym calls fun with oneargument, the value to be assigned.
mapplyA multivariate version of sapply. mapply applies FUN to the first elements of each... argument, the second elements, the third elements, and soon.
margin.tableFor a contingency table in array form, computes the sumof table entries for a given index.
mat.or.vecCreates an nr bync zero matrix if nc is greater than 1, and a zerovector of length nr ifnc equals 1.
matchReturns a vector of the positions of (first) matches ofits first argument in its second.
match.argMatches arg againsta table of candidate values as specified by choices, where NULL means to take the firstone.
match.callReturns a call in which all of the specified argumentsare specified by their full names.
match.funWhen called inside functions that take a function asargument, extracts the desired function object while avoidingundesired matching to objects of other types.
matrixCreates a matrix from a given set of values. as.matrix attempts to turn itsargument into a matrix. is.matrix tests if its argument is a(strict) matrix.
maxReturns the (parallel) maxima and minima of the inputvalues.
max.colFinds the maximum position for each row of a matrix, breaking ties at random.
meanGeneric function for the (trimmed) arithmeticmean.
memory.profileLists the usage of the cons cells by SEXPREC type.
merge, merge.data.frame, merge.defaultMerge two data frames by common columns or row names orperform other versions of database joinoperations.
messageGenerates a diagnostic message from itsarguments.
mgetSearches for an R object with a given name and returnsit.
minReturns the (parallel) maxima and minima of the inputvalues.
missingTests whether a value was specified as an argument to afunction.
mode, mode<-Get or set the type of storage mode of anobject.
monthsExtracts the months from an object.
mostattributes<-The mostattributes assignment takes special care of thedim, names, and dimnames attributes and assigns them only whenvalid, whereas an attributes assignment would give an error ifany were not.
names, names<-Functions to get or set the names of an object.
nargsWhen used inside a function body, returns the number ofarguments supplied to that function, including positional arguments leftblank.
ncharTakes a character vector as an argument and returns avector whose elements contain the sizes of the correspondingelements of x.
ncol, nrowReturn the number of rows or columns present inx.
new.envGets, sets, tests for, and createsenvironments.
ngettextIf Native Language Support was enabled in this build ofR, attempts to translate character vectors or set where thetranslations are to be found.
nlevelsReturns the number of levels that its argumenthas.
noquotePrints character strings without quotes.
numericCreates or coerces objects of type "numeric". is.numeric is a more general test ofan object being interpretable as numbers.
numeric_versionA simple S3 class for representing numeric versions, including package versions, and associated methods.
nzcharA fast way to find out if elements of a charactervector are nonempty strings.
objectsls and objects return a vector of characterstrings giving the names of the objects in a specifiedenvironment.
oldClass, oldClass<-Get and set the class attribute.
on.exitRecords the expression given as its argument as needingto be executed when the current function exits (eithernaturally or as the result of an error).
open, open.connectionFunctions to create, open, and closeconnections.
open.srcfile, open.srcfilecopyThese functions are for working with sourcefiles.
optionsAllows the user to set and examine a variety of globaloptions that affect the way in which Rcomputes and displays its results.
orderReturns a permutation that rearranges its firstargument into ascending or descending order, breaking ties byfurther arguments.
orderedUsed to create ordered factors.
outerThe outer product of the arrays X and Y is the array A with dimension c(dim(X), dim(Y)), where elementA[c(arrayindex.x, arrayindex.y)] =FUN(X[arrayindex.x], Y[arrayindex.y], ...).
packBitsConversion and manipulation of objects of type "raw".
packageEventsetHook provides ageneral mechanism for users to register hooks, a list offunctions to be called from system (or user) functions. Theinitial set of hooks is associated with events onpackages/name spaces: these hooks are named via calls topackageEvent.
packageStartupMessageGenerates a diagnostic message from itsarguments.
package_versionCreates a package_version object (a simple S3 class forrepresenting numeric versions, including package versions, andassociated methods).
pairlistFunction to construct, coerce, and check for both kindsof R lists.
parent.env, parent.env<-Get, set, test for, and create environments.
parent.frameProvides access to environments ("frames" in Sterminology) associated with functions farther up the callingstack.
parseReturns the parsed but unevaluated expressions in alist.
parseNamespaceFileInternal namespace support function. Not intended to becalled directly.
pasteConcatenates vectors after converting tocharacter.
path.expandExpands a path name, for example, by replacing aleading tilde by the user's home directory (if defined on thatplatform).
pipeFunction to create, open, and closeconnections.
pmatchSeeks matches for the elements of its first argumentamong those of its second.
pmax, pmax.int, pmin, pmin.intReturn the (parallel) maxima and minima of the inputvalues.
polyrootFinds zeros of a real or complex polynomial.
pos.to.envReturns the environment at a specified position in thesearch path.
prettyComputes a sequence of about n+1 equally spaced "round" valuesthat cover the range of the values in x. The values are chosen so thatthey are 1, 2, or 5 times a power of 10.
prettyNumFormats numbers individually and flexibly, usingC-style formatspecifications.
printPrints its argument and returns itinvisibly (via invisible(x)).
prmatrixAn earlier method for printing matrices, provided for Scompatibility.
proc.timeDetermines how much real and CPU time (in seconds) thecurrently running R process has already taken.
prodReturns the product of all the values present in itsarguments.
prop.tableThis is really sweep(x, margin, margin.table(x, margin), "/") for newbies, except that if margin haslength 0, then one gets x/sum(x).
psigammaSpecial mathematical function related to the beta andgamma functions.
pushBack, pushBackLengthFunctions to push back text lines onto a connection andto inquire about how many lines are currently pushedback.
qAlias for quit.
qrComputes the QR-decomposition of amatrix. It provides an interface to the techniques used in theLINPACK routine DQRDC or the LAPACK routines DGEQP3 and (forcomplex matrices) ZGEQP3.
qr.coefReturns the coefficients obtained when fitting y to thematrix with QR-decomposition qr.
qr.qyReturns Q %*% y, where Q is the (complete)Q matrix.
qr.qtyReturns t(Q) %*% y, where Q is the (complete)Q matrix.
qr.residReturns the residuals obtained when fitting y to thematrix with QR-decomposition qr.
qr.solveSolves systems of equations via theQR-decomposition: ifa is aQR-decomposition, it is the same assolve.qr, but if a is a rectangularmatrix, the QR-decomposition is computedfirst.
qr.fittedReturns the fitted values obtained when fitting y tothe matrix with QR-decompositionqr.
qr.Q, qr.R, qr.XReturns the original matrix from which the object wasconstructed or the components of the decomposition.
quartersExtracts the quarter from an object.
quitThe function quit orits alias q terminates thecurrent R session.
quoteSimply returns its argument. The argument is notevaluated and can be any R expression.
rangeReturns a vector containing the minimum and maximum ofall the given arguments.
rankReturns the sample ranks of the values in a vector.Ties (i.e., equal values) and missing values can be handled inseveral ways.
rapplyA recursive version of lapply.
rawCreates or tests for objects of type "raw".
rawConnection, rawConnectionValueInput and output raw connections.
rawShift, rawToBits, rawToCharConversion and manipulation of objects of type "raw".
rbindTakes a sequence of vector, matrix, or data frameargument and combines by rows, respectively.
rcondComputes the 1- and inf-norm condition numbers for amatrix, also for complex matrices, using standard LAPACKroutines.
read.dcfReads or writes an R object from/to a file in Debiancontrol file format.
readBinReads binary data from a connection or writes binarydata to a connection.
readCharTransfers character strings to and from connections, without assuming they are null terminated on theconnection.
readLinesReads some or all text lines from a connection.
readlineReads a line from the terminal.
realThis function is the same as its double equivalents and is providedfor backward compatibility only.
reg.finalizerRegisters an R function to be called upon garbagecollection of objects or (optionally) at the end of an Rsession.
regexprSearches for matches to pattern (its first argument) withinthe character vector x(second argument), and returns detailed results.
remove, rmUsed to remove objects.
removeCConverterReturns TRUE if an element in the converter list wasidentified and removed. (This function provides facilities tomanage the extensible list of converters used to translate Robjects into C pointers for use in .C calls.)
removeTaskCallbackUn-registers a function that was registered earlier viaaddTaskCallback.
rep, rep.intrep replicates thevalues in x. It is ageneric function, and the (internal) default method isdescribed here. rep.int isa faster simplified version for the most common case.
replaceReplaces the values in x with indices given in list by those given in values. If necessary, the values invalues arerecycled.
replicateA wrapper for the common use of sapply for repeated evaluation of anexpression (which will usually involve random numbergeneration).
requirelibrary and require load add-onpackages.
retracememMarks an object so that a message is printed wheneverthe internal function duplicate is called. This happenswhen two objects share the same memory and one of them ismodified. It is a major cause of hard-to-predict memory use inR.
returnProvides the base mechanisms for defining new functionsin the R language.
revProvides a reversed version of its argument. It isgeneric function with a default method for vectors and one fordendrograms.
rleComputes the lengths and values of runs of equal valuesin a vector—or the reverse operation.
roundRounds the values in its first argument to thespecified number of decimal places (default 0).
round.POSIXtRounds or truncates date-time objects.
rowReturns a matrix of integers indicating their rownumber in a matrix-like object or a factor indicating the rowlabels.
row.names, row.names<-Get or set the row names attribute from an object (suchas a data frame).
rowMeans, rowSumsForm row and column sums and means for numericarrays.
rownames, rownames<-Retrieve or set the row or column names of amatrix-like object.
rowsumComputes column sums across rows of a matrix-likeobject for each level of a grouping variable.
sQuoteSingle- or double-quote text by combining withappropriate single or double left and right quotationmarks.
sampleTakes a sample of specified size from the elements ofx using either with orwithout replacement.
sapplyA user-friendly version of lapply by default returning a vectoror matrix if appropriate.
saveWrites an external representation of R objects to aspecified file. The objects can be read back from the file ata later date by using the function load (or data in some cases).
save.imageJust a shortcut for "save my current workspace, " i.e., save(list = ls(all=TRUE), file =".RData"). It is also what happens with q("yes").
saveNamespaceImageLow-level namespace support function.
scaleA generic function whose default method centers and/orscales the columns of a numeric matrix.
scanReads data into a vector or list from the console orfile.
searchGives a list of attachedpackages (see library), and R objects, usuallydata.frames.
searchpathsGives a similar character vector to search, with the entries forpackages being the path to the package used to load thecode.
seek, seek.connectionFunctions to reposition connections.
seq, seq.int, seq_along, seq_lenGenerate regular sequences. seq is a standard generic with adefault method. seq.int isan internal generic that can be much faster but has a fewrestrictions. seq_along andseq_len are very fastprimitives for two common cases.
sequenceFor each element of nvec, the sequence seq_len(nvec[i]) is created. Theseare concatenated and the result returned.
serializeA simple low-level interface for serializing toconnections.
set.seedThe recommended way to specify seeds for randon numbergeneration.
setCConverterStatusProvides facilities to manage the extensible list ofconverters used to translate R objects into C pointers for usein .C calls. The number anda description of each element in the list can be retrieved.One can also query and set the activity status of individualelements, temporarily ignoring them. And one can removeindividual elements.
setHookAllows users to set actions to be taken before packagesare attached/detached and namespaces are (un)loaded.
setSessionTimeLimit, setTimeLimitFunctions to set CPU and/or elapsed time limits fortop-level computations or the current session.
setdiff, setequalPerform set union, intersection, (asymmetric!) difference, equality, and membership on twovectors.
setwdUsed to set the working directory to dir.
shQuoteQuotes a string to be passed to an operating systemshell.
showConnectionsDisplays aspects of connections.
signReturns a vector with the signs of the correspondingelements of x (the sign ofa real number is 1, 0, or −1 if the number is positive, zero, or negative, respectively).
signalConditionProvides a mechanism for handling unusual conditions, including errors and warnings.
signifRounds the values in its first argument to thespecified number of significant digits.
simpleCondition, simpleError, simpleMessage, simpleWarningProvide a mechanism for handling unusual conditions, including errors and warnings.
sinComputes the sine.
sinhComputes the hyperbolic sine.
sink, sink.numbersink diverts Routput to a connection. sink.number() reports how manydiversions are in use. sink.number(type = "message")reports the number of the connection currently being used forerror messages.
slice.indexReturns a matrix of integers indicating the number oftheir slice in a given array.
socketConnectionFunction to create, open, and closeconnections.
socketSelectWaits for the first of several socket connections tobecome available.
solveThis generic function solves the equation a \%*\% x = b for x, where b can be either a vector or amatrix.
solve.qrThe method of solve for qr objects.
sortSorts (or orders) a vector orfactor (partially) into ascending (or descending)order.
sourceCauses R to accept its input from the named file or URL(the name must be quoted) or connection.
split, split<-split divides thedata in the vector x intothe groups defined by f.The replacement formsreplace values corresponding to such a division.
sprintfA wrapper for the C function sprintf that returns a charactervector containing a formatted combination of text and variablevalues.
sqrtComputes miscellaneous mathematical functions. Thenaming follows the standard for computer languages such as Cor FORTRAN.
srcfileThis function is for working with source files.
srcfilecopyThis function is for working with source files.
srcrefThis function is for working with source files.
standardGenericDispatches the method defined for a generic functionf, using the actualarguments in the frame from which it is called.
stderrDisplays aspects of connections.
stdinDisplays aspects of connections.
stdoutDisplays aspects of connections.
stopStops execution of the current expression and executesan error action.
stopifnotIf any of the expressions in ... are not all TRUE, stop is called, producing an errormessage indicating the first of theelements of ... which werenot true.
storage.mode, storage.mode<-Get or set the type of storage mode of anobject.
strftime, strptimeFunctions to convert between character representationsand objects of classes "POSIXlt" and "POSIXct" representing calendardates and times.
strsplitSplits the elements of a character vector x into substrings according to thepresence of substring splitwithin them.
strtrimTrims character strings to specified displaywidths.
structureReturns a given object with further attributesset.
strwrapWraps character strings to format paragraphs.
subPerforms replacement of matches determined by regularexpression matching.
subsetReturns subsets of vectors, matrices, or data framesthat meet conditions.
substituteReturns the parse tree for the (unevaluated) expressionexpr, substituting anyvariables bound in env.
substr, substr<-, substring, substring<-Extract or replace substrings in a charactervector.
sumReturns the sum of all the values present in itsarguments.
summaryA generic function used to produce summaries of theresults of various model fitting.
suppressMessages, suppressPackageStartupMessagesGenerate a diagnostic message from theirarguments.
suppressWarningsGenerates a warning message that corresponds to itsargument(s) and (optionally) the expression or function fromwhich it was called.
svdComputes the singular-value decomposition of arectangular matrix.
sweepReturns an array obtained from an input array bysweeping out a summary statistic.
switchEvaluates EXPR andaccordingly chooses one of the additional arguments (in...).
sys.call, sys.calls, sys.frame, sys.frames, sys.function, sys.nframe, sys.on.exit, sys.parent, sys.parentsProvide access to environments ("frames" in Sterminology) associated with functions farther up the callingstack.
sys.sourceParses expressions in a given file and thensuccessively evaluates them in the specifiedenvironment.
sys.statusProvides access to environments ("frames" in Sterminology) associated with functions farther up the callingstack.
systemInvokes the OS command specified by command.
system.fileFinds the full filenames of files in packages, etc.
system.timeReturns CPU (and other) times that expr used.
tGiven a matrix or data.frame x, t returns the transpose of x. Methods include t.data.frame and t.default.
tableUses the cross-classifying factors to build acontingency table of the counts at each combination of factorlevels.
tabulateTakes the integer-valued vector bin and counts the number of timeseach integer occurs in it.
tanComputes the tangent.
tanhComputes the hyperbolic tangent.
tapplyApplies a function to each cell of a ragged array, i.e., to each (nonempty) group of values given by a uniquecombination of the levels of certain factors.
taskCallbackManagerProvides an entirely S-language mechanism for managingcallbacks or actions that are invoked at the conclusion ofeach top-level task. Essentially, we register a single Rfunction from this manager with the underlying nativetask-callback mechanism, and this function handles invokingthe other R callbacks under the control of the manager. Themanager consists of a collection of functions that accessshared variables to manage the list of user-levelcallbacks.
tcrossprodGiven matrices x andy as arguments, returns amatrix cross-product. This is formally equivalent to (butusually slightly faster than) the call x \%*\% t(y) (tcrossprod).
tempdir, tempfiletempfile returns avector of character strings that can be used as names fortemporary files.
textConnection, textConnectionValueInput and output text connections.
toStringThis is a helper function for format to produce a single-characterstring describing an R object.
tolowerTranslates characters in character vectors, inparticular, from upper- to lowercase or vice versa.
topenvFinds the top-level environment.
toupperTranslates characters in character vectors, inparticular, from upper-to lower case or vice versa.
traceA call to traceallows you to insert debugging code (e.g., a call to browser or recover) at chosen places in anyfunction. A call to untracecancels the tracing.
tracebackBy default, traceback() prints the call stack ofthe last uncaught error, i.e., the sequence of calls that ledto the error.
tracememMarks an object so that a message is printed wheneverthe internal function duplicate is called.
tracingStateTracing can be temporarily turned on or off globally bycalling tracingState.
transformReturns a new data frame by applying a set oftransformations to an existing data frame.
trigammaSpecial mathematical functions related to the beta andgamma functions.
truncTakes a single numeric argument x and returns a numeric vectorcontaining the integers formed by truncating the values inx toward 0.
truncate, truncate.connectionFunctions to reposition connections.
tryA wrapper to run an expression that might fail andallow the user's code to handle error recovery.
tryCatchProvides a mechanism for handling unusual conditions, including errors and warnings.
typeofDetermines the (R internal) type of storage mode of anyobject.
unclassReturns (a copy of) its argument with its classattribute removed.
undebugSets, unsets, or queries the debugging flag on afunction.
unionPerforms set union, intersection, (asymmetric!) difference, equality, and membership on twovectors.
uniqueReturns a vector, data frame, or array like x but with duplicate elements/rowsremoved.
units, units<-Extracts units from a difftime object.
unix.timeReturns CPU (and other) times that expr used.
unlinkDeletes the file(s) or directories specified byx.
unlistGiven a list structure x, simplifies it to produce a vectorthat contains all the atomic components that occur in x.
unloadNamespaceFunction to load and unload namespaces.
unlockBindingUnlocks individual bindings in a specifiedenvironment.
unnameRemoves the names ordimnames attribute of an Robject.
unserializeA simple low-level interface for serializing toconnections.
unsplitReverses the effect of split.
untraceA call to traceallows you to insert debugging code (e.g., a call to browser or recover) at chosen places in anyfunction. A call to untracecancels the tracing.
untracememUndoes a call to tracemem.
unzFunction to create, open, and closeconnections.
upper.triReturns a matrix of logicals the same size of a givenmatrix with entries TRUE inthe lower or upper triangle.
urlFunction to create, open, and closeconnections.
utf8ToIntConversion of UTF-8 encoded character vectors to andfrom integer vectors.
vectorProduces a vector of a given length and mode.
warningGenerates a warning message that corresponds to itsargument(s) and (optionally) the expression or function fromwhich it was called.
warningswarnings and itsprint method print thevariable last.warning in apleasing form.
weekdaysExtracts the weekdays from an object.
whichGives the TRUEindices of a logical object, allowing for arrayindices.
which.max, which.minDetermines the location, i.e., index of the (first)minimum or maximum of a numeric vector.
withEvaluates an R expression in an environment constructedfrom data, possibly modifying the originaldata.
withCallingHandlersCalling handlers are established by withCallingHandlers.
withRestartsRestarts are used for establishing recovery protocols.They can be established using withRestarts.
withVisibleEvaluates an expression, returning it in a two-elementlist containing its value and a flag showing whether it wouldautomatically print.
withinEvaluates an R expression in an environment constructedfrom data, possibly modifying the original data.
writeThe data (usually a matrix) x is written to file file. If the object is atwo-dimensional matrix, you need to transpose it to get thecolumns in file the same asthose in the internal representation.
write.dcfReads or writes an R object from/to a file in Debiancontrol file format.
writeBinReads binary data from a connection or writes binarydata to a connection.
writeCharTransfers character strings to and from connections, without assuming they are null terminated on theconnection.
writeLinesWrites text lines to a connection.
xorThis operator acts on logical vectors.
xpdrows.data.frameAuxiliary function for use with data frames.
xtfrmA generic auxiliary function that produces a numericvector that will sort in the same order as x.
zapsmallDetermines a digitsargument dr for callinground(x, digits = dr) suchthat values close to 0 (compared with the maximal absolutevalue) are "zapped, " i.e., treated as 0.
~Tilde is used to separate the left- and righthand sidesin model formula.

Data Sets

DatasetClassDescription
FlogicalAlias for FALSE.
LETTERScharacterConstants built into R.
R.version, versionsimple.listR.Version() providesdetailed information about the version of R running. R.version is a variable (a list) holding this information (andversion is a copy of it forS compatibility).
R.version.stringcharacterR.version.string isa copy of R.version$version.string.
TlogicalAlias for TRUE.
letters, month.abb, month.namecharacterVectors of constants built into R.
pinumericAlias for the constant pi.

Pages: 1, 2, 3, 4, 5

Next Pagearrow