O'Reilly    
 Published on O'Reilly (http://oreilly.com/)
 See this if you're having trouble printing code examples


Appendix: R Reference - R in a Nutshell

by Joseph Adler
R in a Nutshell book cover

This excerpt is from R in a Nutshell. R is rapidly becoming the standard for developing statistical software, and R in a Nutshell provides a quick and practical way to learn this increasingly popular open source language and environment. You'll not only learn how to program in R, but also how to find the right user-contributed R packages for statistical modeling, visualization, and bioinformatics.

buy button

Click on any of the function names or data set names below to jump to its description. To filter the function and data set names, enter text into the Filter box below.

Filter

base

Functions

! != $, $<- %% %*% %/% %in% %o% %x% & && * + - / : :: ::: < > >= <= == @ Arg Conj Cstack_info Encoding, Encoding<- Filter Find I ISOdate, ISOdatetime Im La.svd Map Mod NCOL, NROW Negate NextMethod Position R.Version R.home RNGkind RNGversion R_system_version Re Recall Reduce Sys.Date, Sys.time Sys.chmod Sys.getenv Sys.getlocale Sys.getpid Sys.glob Sys.info Sys.localeconv Sys.setenv Sys.setlocale Sys.sleep Sys.timezone Sys.umask Sys.unsetenv Sys.which UseMethod Vectorize ^ abbreviate abs acos acosh addNA addTaskCallback agrep alist all all.equal all.names, all.vars any anyDuplicated aperm append apply args array as.Date as.POSIXct, as.POSIXlt as.array as.call as.character as.complex as.data.frame as.difftime as.double as.environment as.expression as.factor as.function as.hexmode as.integer as.list as.logical as.matrix as.name as.null as.numeric as.numeric_version as.octmode as.ordered as.package_version as.pairlist as.raw as.real as.symbol as.table as.vector asS4 asin asinh assign atan atan2 atanh attach attachNamespace attr, attr<- attributes, attributes<- autoload, autoloader backsolve baseenv basename besselI, besselJ, besselK, besselY beta bindingIsActive, bindingIsLocked bindtextdomain body, body<- bquote break browser builtins by bzfile c call callCC capabilities casefold cat cbind ceiling char.expand charToRaw character charmatch chartr check_tzones chol chol2inv choose class, class<- close, close.connection closeAllConnections col colMeans colSums colnames, colnames<- commandArgs comment, comment<- computeRestarts conditionCall, conditionCall.condition, conditionMessage, conditionMessage.condition conflicts contributors crossprod cummax, cummin, cumprod, cumsum cut cut.Date, cut.POSIXt dQuote data.class data.frame data.matrix date debug default.stringsAsFactors delayedAssign deparse det, determinant detach dget diag, diag<- diff, diff.Date, diff.POSIXt, diff.default difftime digamma dim, dim.data.frame, dim<-, dimnames, dimnames.data.frame, dimnames<-, dimnames<-.data.frame dir, dir.create dirname do.call double dput drop dump duplicated dyn.load, dyn.unload eapply eigen emptyenv encodeString env.profile environment, environment<- environmentIsLocked environmentName eval, eval.parent, evalq exists exp expand.grid expm1 expression factor factorial fifo file file.access file.append file.choose file.copy, file.create, file.exists file.info file.path file.remove, file.rename file.show file.symlink findInterval findRestart floor flush, flush.connection force formals, formals<- format, format.AsIs formatC formatDL forwardsolve function gamma gc gc.time gcinfo gctorture get getAllConnections getCConverterDescriptions, getCConverterStatus getConnection getDLLRegisteredRoutines, getDLLRegisteredRoutines.DLLInfo, getDLLRegisteredRoutines.character getExportedValue getHook getLoadedDLLs getNamespace, getNamespaceExports, getNamespaceImports, getNamespaceName, getNamespaceUsers, getNamespaceVersion getNativeSymbolInfo getNumCConverters getOption getRversion getSrcLines getTaskCallbackNames geterrmessage gettext gettextf getwd gl globalenv gregexpr, grep, grepl, gsub gsub gzcon gzfile iconv, iconvlist icuSetCollate identical identity ifelse inherits intToBits intToUtf8 integer interaction interactive intersect inverse.rle invisible invokeRestart, invokeRestartInteractively is.R is.array is.atomic is.call is.character is.complex is.data.frame is.double is.element is.environment is.expression is.factor is.finite, is.infinite is.function is.integer is.language is.list is.loaded is.logical is.matrix is.na, is.na<- is.name is.nan is.null is.numeric, is.numeric.Date, is.numeric.POSIXt is.numeric_version is.ordered is.package_version is.pairlist is.primitive is.qr is.raw is.recursive is.symbol is.table is.unsorted is.vector isIncomplete, isOpen isRestart isS4 isSeekable isSymmetric, isSymmetric.matrix isTRUE isdebugged jitter julian, julian.Date, julian.POSIXt kappa, kappa.defaultm, kappa.lm, kappa.qr, kappa.tri kronecker l10n_info labels lapply lazyLoad lbeta, lchoose length, length<-, length<-.factor levels, levels.default, levels<-, levels<-.factor lfactorial, lgamma library library.dynam library.dynam.unload licence list list.files load loadNamespace loadedNamespaces loadingNamespaceInfo local lockBinding lockEnvironment log log10 log1p log2 logical lower.tri ls make.names make.unique makeActiveBinding mapply margin.table mat.or.vec match match.arg match.call match.fun matrix max max.col mean memory.profile merge, merge.data.frame, merge.default message mget min missing mode, mode<- months mostattributes<- names, names<- nargs nchar ncol, nrow new.env ngettext nlevels noquote numeric numeric_version nzchar objects oldClass, oldClass<- on.exit open, open.connection open.srcfile, open.srcfilecopy options order ordered outer packBits packageEvent packageStartupMessage package_version pairlist parent.env, parent.env<- parent.frame parse parseNamespaceFile paste path.expand pipe pmatch pmax, pmax.int, pmin, pmin.int polyroot pos.to.env pretty prettyNum print prmatrix proc.time prod prop.table psigamma pushBack, pushBackLength q qr qr.coef qr.qy qr.qty qr.resid qr.solve qr.fitted qr.Q, qr.R, qr.X quarters quit quote range rank rapply raw rawConnection, rawConnectionValue rawShift, rawToBits, rawToChar rbind rcond read.dcf readBin readChar readLines readline real reg.finalizer regexpr remove, rm removeCConverter removeTaskCallback rep, rep.int replace replicate require retracemem return rev rle round round.POSIXt row row.names, row.names<- rowMeans, rowSums rownames, rownames<- rowsum sQuote sample sapply save save.image saveNamespaceImage scale scan search searchpaths seek, seek.connection seq, seq.int, seq_along, seq_len sequence serialize set.seed setCConverterStatus setHook setSessionTimeLimit, setTimeLimit setdiff, setequal setwd shQuote showConnections sign signalCondition signif simpleCondition, simpleError, simpleMessage, simpleWarning sin sinh sink, sink.number slice.index socketConnection socketSelect solve solve.qr sort source split, split<- sprintf sqrt srcfile srcfilecopy srcref standardGeneric stderr stdin stdout stop stopifnot storage.mode, storage.mode<- strftime, strptime strsplit strtrim structure strwrap sub subset substitute substr, substr<-, substring, substring<- sum summary suppressMessages, suppressPackageStartupMessages suppressWarnings svd sweep switch sys.call, sys.calls, sys.frame, sys.frames, sys.function, sys.nframe, sys.on.exit, sys.parent, sys.parents sys.source sys.status system system.file system.time t table tabulate tan tanh tapply taskCallbackManager tcrossprod tempdir, tempfile textConnection, textConnectionValue toString tolower topenv toupper trace traceback tracemem tracingState transform trigamma trunc truncate, truncate.connection try tryCatch typeof unclass undebug union unique units, units<- unix.time unlink unlist unloadNamespace unlockBinding unname unserialize unsplit untrace untracemem unz upper.tri url utf8ToInt vector warning warnings weekdays which which.max, which.min with withCallingHandlers withRestarts withVisible within write write.dcf writeBin writeChar writeLines xor xpdrows.data.frame xtfrm zapsmall ~

boot

class

cluster

codetools

foreign

grDevices

graphics

grid

KernSmooth

lattice

Functions

Rows as.shingle, as.factorOrShingle axis.default banking barchart bwplot canonical.theme cloud col.whitebg contourplot current.column current.panel.limits current.row densityplot diag.panel.splom do.breaks dotplot draw.colorkey draw.key equal.count histogram is.shingle larrows, llines, lplot.xy, lpoints, lpolygon, lrect, lsegments, ltext, panel.points, panel.polygon, panel.rect, panel.segments, panel.text lattice.getOption, lattice.options latticeParseFormula level.colors levelplot ltransform3dMatrix, ltransform3dto3d make.groups oneway packet.number packet.panel.default panel.3dscatter, panel panel.abline panel.average panel.arrows panel.axis panel.barchart panel.brush.splom panel.bwplot panel.cloud panel.contourplot panel.curve panel.densityplot panel.dotplot panel.error panel.fill panel.grid panel.histogram panel.identify panel.levelplot panel.linejoin panel.lines panel.link.splom panel.lmline panel.loess panel.mathdensity panel.number panel.pairs panel.parallel panel.qq panel.qqmath panel.qqmathline panel.refline panel.rug panel.smoothScatter panel.splom panel.stripplot panel.superpose, panel.superpose.2 panel.tmd.default, panel.tmd.qqmath panel.violin panel.wireframe panel.xyplot parallel bwplot, prepanel.default.cloud, prepanel.default.densityplot, prepanel.default.histogram, prepanel.default.levelplot, prepanel.default.parallel, prepanel.default.qq, prepanel.default.qqmath, prepanel.default.splom, prepanel.default.xyplot prepanel.lmline, prepanel.loess, prepanel.qqmathline prepanel.tmd.default, prepanel.tmd.qqmath qq qqmath rfs shingle show.settings simpleKey simpleTheme splom standard.theme strip.custom strip.default stripplot tmd trellis.currentLayout trellis.device trellis.focus, trellis.grobname trellis.last.object trellis.panelArgs trellis.par.get, trellis.par.set trellis.switchFocus trellis.unfocus trellis.vpname which.packet wireframe xscale.components.default, yscale.components.default xyplot

MASS

methods

Functions

@<- MethodAddCoerce Quote S3Class, S3Class<- S3Part, S3Part<- addNextMethod allNames as, as<- asMethodDefinition assignClassDef assignMethodsMetaData balanceMethodsList body<- cacheGenericsMetaData, cacheMetaData cacheMethod callGeneric callNextMethod canCoerce cbind2 checkSlotAssignment classMetaName classesToAM coerce, coerce<- completeClassDefinition completeExtends completeSubclasses conformMethod defaultDumpName defaultPrototype doPrimitiveMethod dumpMethod dumpMethods elNamed, elNamed<- existsFunction existsMethod extends findClass findFunction findMethod findMethodSignatures findMethods findUnique fixPre1.8 formalArgs functionBody, functionBody<- generic.skeleton getAllSuperClasses getClass, getClassDef getClasses getDataPart getFromClassDef getFunction getGeneric getGenerics getGroup getGroupMembers getMethod getMethods getMethodsForDispatch getMethodsMetaData getPackageName getSlots getValidity hasArg hasMethod hasMethods implicitGeneric initialize is isClass isClassDef isClassUnion isGeneric isGroup isSealedClass, isSealedMethod isVirtualClass isXS3Class listFromMethods makeClassRepresentation makeExtends makeGeneric makePrototypeFromClassDef makeStandardGeneric matchSignature metaNameUndo method.skeleton methodSignatureMatrix methodsPackageMetaName missingArg new newBasic newClassRepresentation newEmptyObject packageName packageSlot, packageSlot<- possibleExtends prohibitGeneric promptClass promptMethods prototype rbind2 reconcilePropertiesAndPrototype registerImplicitGenerics rematchDefinition removeClass removeGeneric removeMethod removeMethods representation requireMethods resetClass resetGeneric sealClass selectMethod selectSuperClasses sessionData setAs setClass setClassUnion setDataPart setGeneric setGenericImplicit setGroupGeneric setIs setMethod setOldClass setPackageName setPrimitiveMethods setReplaceMethod setValidity show showClass showDefault showExtends showMethods sigToEnv signature slot, slot<- slotNames slotsFromS3 substituteDirect standardGeneric substituteFunctionArgs superClassDepth testInheritedMethods testVirtual traceOff traceOn tryNew, trySilent unRematchDefinition validObject validSlotNames

mgcv

nlme

nnet

rpart

spatial

splines

stats

Functions

AIC ARMAacf ARMAtoMA Box.test C D Gamma HoltWinters IQR KalmanForecast, KalmanLike, KalmanRun, KalmanSmooth NLSstAsymptotic NLSstClosestX NLSstLfAsymptote NLSstRtAsymptote PP.test SSD SSasymp SSasympOff SSasympOrig SSbiexp SSfol SSfpl SSgompertz SSlogis SSmicmen SSweibull StructTS TukeyHSD TukeyHSD.aov acf acf2AR add.scope add1 addmargins aggregate alias anova anova.lmlist ansari.test aov approx approxfun ar arima arima.sim arima0 as.dendrogram as.dist as.formula as.hclust as.stepfun as.ts asOneSidedFormula ave bandwidth.kernel bartlett.test binom.test binomial biplot bw.SJ, bw.bcv, bw.nrd, bw.nrd0, bw.ucv cancor case.names ccf chisq.test clearNames cmdscale coef, coefficients complete.cases confint constrOptim contr.SAS, contr.helmert, contr.poly, contr.sum, contr.treatment contrasts, contrasts<- convolve cooks.distance cophenetic cor cor.test cov cov.wt cov2cor covratio cpgram cutree cycle dbeta dbinom dcauchy dchisq decompose delete.response deltat dendrapply density density.default deriv, deriv3 deviance dexp df df.kernel df.residual dfbeta dfbetas dffits dgamma dgeom dhyper diff.ts diffinv dist dlnorm dlogis dmultinom dnbinom dnorm dpois drop.scope drop.terms drop1 dsignrank dt dummy.coef dunif dweibull dwilcox ecdf eff.aovlist effects embed end estVar expand.model.frame extractAIC factanal family fft filter fisher.test fitted, fitted.values fivenum fligner.test formula frequency friedman.test ftable gaussian getInitial get_all_vars glm glm.control glm.fit hasTsp hat, hatvalues, hatvalues.lm hclust heatmap influence influence.measures integrate interaction.plot inverse.gaussian is.empty.model is.leaf is.mts is.stepfun is.ts is.tskernel isoreg kernapply kernel kmeans knots kruskal.test ks.test ksmooth lag lag.plot line lines.ts lm lm.fit lm.influence lm.wfit loadings loess loess.control loess.smooth logLik loglin lowess ls.diag ls.print lsfit mad mahalanobis make.link makeARIMA makepredictcall manova mantelhaen.test mauchly.test mcnemar.test median median.default medpolish model.extract model.frame model.matrix model.offset model.response model.tables model.weights monthplot mood.test mvfft na.action na.contiguous na.exclude na.fail na.omit na.pass napredict naprint naresid nextn nlm nlminb nls nls.control numericDeriv offset oneway.test optim optimise, optimize order.dendrogram p.adjust pacf pairwise.prop.test pairwise.t.test pairwise.table pairwise.wilcox.test pbeta pbinom pbirthday pcauchy pchisq pexp pf pgamma pgeom phyper plclust plnorm plogis plot.TukeyHSD plot.density plot.ecdf plot.lm plot.mlm plot.spec, plot.spec.coherency, plot.spec.phase plot.stepfun plot.ts pnbinom pnorm poisson poisson.test poly, polym power power.anova.test power.prop.test power.t.test ppoints ppois ppr prcomp predict preplot princomp printCoefmat profile proj promax prop.test prop.trend.test psignrank pt ptukey punif pweibull pwilcox qbeta qbinom qbirthday qcauchy qchisq qexp qf qgamma qgeom qhyper qlnorm qlogis qnbinom qnorm qpois qqline qqnorm qqplot qsignrank qt qtukey quade.test quantile quantile.default quasi quasibinomial quasipoisson qunif qweibull qwilcox r2dtable rbeta rbinom rcauchy rchisq read.ftable rect.hclust reformulate relevel reorder replications reshape resid residuals rexp rf rgamma rgeom rhyper rlnorm rlogis rmultinom rnbinom rnorm rpois rsignrank rstandard rstudent rt runif runmed rweibull rwilcox scatter.smooth screeplot sd se.contrast selfStart setNames shapiro.test simulate smooth smooth.spline smoothEnds sortedXyData spec.ar spec.pgram spec.taper spectrum spline splinefun splinefunH start stat.anova step stepfun stl supsmu symnum t.test termplot terms time toeplitz ts ts.intersect ts.plot ts.union tsSmooth tsdiag tsp, tsp<- uniroot update var var.test variable.names varimax vcov weighted.mean weighted.residuals weights wilcox.test window, window<- write.ftable xtabs

stats4

survival

tcltk

tools

utils

Functions

? RShowDoc RSiteSearch Rprof Rprofmem Rtangle RtangleSetup RtangleWritedoc RweaveChunkPrefix RweaveEvalWithOpt RweaveLatex RweaveLatexFinish RweaveLatexOptions RweaveLatexSetup RweaveLatexWritedoc RweaveTryStop Stangle Sweave SweaveSyntConv URLdecode URLencode View alarm apropos argsAnywhere as.person as.personList as.relistable as.roman assignInNamespace available.packages browseEnv browseURL browseVignettes bug.report capture.output checkCRAN chooseCRANmirror citEntry citFooter citHeader citation close.socket combn compareVersion contrib.url count.fields data data.entry, dataentry, de, de.ncols, de.restore, de.setup debugger demo download.file download.packages dump.frames edit emacs example file.edit file_test find fix fixInNamespace flush.console formatOL, formatUL getAnywhere getCRANmirrors getFromNamespace getS3method getTxtProgressBar glob2rx head help help.request help.search help.start history index.search install.packages installed.packages is.relistable limitedLabels loadhistory localeToCharset ls.str, lsf.str make.packages.html make.socket makeRweaveLatexCodeRunner memory.limit memory.size menu methods mirror2html modifyList new.packages normalizePath nsl object.size old.packages package.skeleton packageDescription packageStatus page person personList pico prompt promptData promptPackage read.DIF read.csv, read.csv2, read.delim, read.delim2 read.fortran read.fwf read.socket read.table readCitationFile recover relist remove.packages rtags savehistory select.list sessionInfo setRepositories setTxtProgressBar stack str strOptions summaryRprof tail timestamp toBibtex toLatex txtProgressBar type.convert unstack unzip update.packageStatus update.packages upgrade url.show vi vignette write.csv, write.csv2 write.socket write.table wsbrowser xedit xemacs zip.file.extract

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.

boot

This package provides functions for bootstrapresampling.

Functions

FunctionDescription
EEF.profileCalculates the log-likelihood for a mean using anempirical exponential family likelihood.
EL.profileCalculates the log-likelihood for a mean using anempirical likelihood.
abc.ciCalculates equitailed two-sided nonparametricapproximate bootstrap confidence intervals for a parameter, given a set of data and an estimator of the parameter, usingnumerical differentiation.
bootGenerates Rbootstrap replicates of a statistic applied to data.
boot.arrayTakes a bootstrap object calculated by one of thefunctions boot, censboot, or tilt.boot and returns the frequency(or index) array for the bootstrap resamples.
boot.ciGenerates five different types of equitailed two-sidednonparametric confidence intervals. These are the first-ordernormal approximation, the basic bootstrap interval, theStudentized bootstrap interval, the bootstrap percentileinterval, and the adjusted bootstrap percentile (BCa)interval. All or a subset of these intervals can begenerated.
censbootApplies types of bootstrap resampling that have beensuggested to deal with right-censored data. It can alsoperform model-based resampling using a Cox regressionmodel.
controlFinds control variate estimates from a bootstrap outputobject.
corrCalculates the weighted correlation given a data setand a set of weights.
cum3Calculates an estimate of the third cumulant, orskewness, of a vector. Also, if more than one vector isspecified, a product-moment of order 3 is estimated.
cv.glmCalculates the estimated K-foldcross-validation prediction error for generalized linearmodels.
empinfCalculates the empirical influence values for astatistic applied to a data set.
envelopeCalculates overall and pointwise confidence envelopesfor a curve based on bootstrap replicates of the curveevaluated at a number of fixed points.
exp.tiltCalculates exponentially tilted multinomialdistributions such that the resampling distributions of thelinear approximation to a statistic have the requiredmeans.
freq.arrayTakes a matrix of indices for nonparametric bootstrapresamples and returns the frequencies of the originalobservations in each resample.
glm.diagCalculates jackknife deviance residuals, standardizeddeviance residuals, standardized Pearson residuals, approximate Cook statistic, leverage, and estimated dispersion.
glm.diag.plotsMakes plot of jackknife deviance residuals againstlinear predictor, normal scores plots of standardized devianceresiduals, plot of approximate Cook statistics againstleverage/(1 − leverage), and case plot of Cookstatistic.
imp.moments, imp.prob, imp.quantileCentral moment, tail probability, and quantileestimates for a statistic under importance resampling.
imp.weightsCalculates the importance sampling weight required tocorrect for simulation from a distribution with probabilitiesp when estimates arerequired assuming that simulation was from an alternativedistribution with probabilities q.
inv.logitGiven a numeric object, returns the inverse logit ofthe values.
jack.after.bootCalculates the jackknife influence values from abootstrap output object and plots the correspondingjackknife-after-bootstrap plot.
k3.linearEstimates the skewness of a statistic from itsempirical influence values.
lik.CIFunction for use with the practicals in Davison andHinkley (1997), Bootstrap Methods and TheirApplications, Cambridge Series in Statistical andProbabilistic Mathematics, No. 1.
linear.approxTakes a bootstrap object and, for each bootstrapreplicate, calculates the linear approximation to thestatistic of interest for that bootstrap sample.
logitCalculates the logit of proportions.
nested.corrFunction for use with the practicals in Davison andHinkley (1997), Bootstrap Methods and TheirApplications, Cambridge Series in Statistical andProbabilistic Mathematics, No. 1.
norm.ciUsing the normal approximation to a statistic, calculates equitailed two-sided confidence intervals.
saddleCalculates a saddlepoint approximation to thedistribution of a linear combination of Wat a particular point u, where W is a vector of randomvariables.
saddle.distnApproximates an entire distribution using saddlepointmethods.
simplexThis function will optimize the linear functiona\%*\%x subject to theconstraints A1\%*\%x <=b1, A2\%*\%x >=b2, A3\%*\%x =b3, and x >=0. Either maximization or minimization is possiblebut the default is minimization.
smooth.fUses the method of frequency smoothing to find adistribution on a data set that has a required value, theta, of the statistic ofinterest.
tilt.bootThis function will run an initial bootstrap with equalresampling probabilities (if required) and will use the outputof the initial run to find resampling probabilities that putthe value of the statistic at required values. It then runs animportance resampling bootstrap using the calculatedprobabilities as the resampling distribution.
tsbootGenerates Rbootstrap replicates of a statistic applied to a time series.The replicate time series can be generated using fixed orrandom block lengths or can be model-based replicates.
var.linearEstimates the variance of a statistic from itsempirical influence values.

Data Sets

Data SetClassDescription
acmedata.frameThe acme data framehas 60 rows and 3 columns. The excess returns for the AcmeCleveland Corporation, along with those for all stocks listedon the New York and American Stock Exchanges, were recordedover a 5-year period. These excess returns are relative to thereturn on a riskless investment such as U.S. Treasurybills.
aidsdata.frameThe aids data framehas 570 rows and 6 columns. Although all cases of AIDS inEngland and Wales must be reported to the Communicable DiseaseSurveillance Centre, there is often a considerable delaybetween the time of diagnosis and the time that it isreported. In estimating the prevalence of AIDS, account mustbe taken of the unknown number of cases that have beendiagnosed but not reported. The data set here records thereported cases of AIDS diagnosed from July 1983 until the endof 1992. The data is cross-classified by the date of diagnosisand the time delay in the reporting of the cases.
airconditdata.frameProschan reported on the times between failures of theair-conditioning equipment in 10 Boeing 720 aircraft. Theaircondit data framecontains the intervals for the ninth aircraft, while aircondit7 contains those for theseventh aircraft. Both data frames have just one column. Notethat the data has been sorted into increasing order.
aircondit7data.frameProschan reported on the times between failures of theair-conditioning equipment in 10 Boeing 720 aircraft. Theaircondit data framecontains the intervals for the ninth aircraft, while aircondit7 contains those for theseventh aircraft. Both data frames have just one column. Notethat the data has been sorted into increasing order.
amisdata.frameThe amis data framehas 8, 437 rows and 4 columns. In a study into the effect thatwarning signs have on speeding patterns, Cambridgeshire CountyCouncil considered 14 pairs of locations. The locations werepaired to account for factors such as traffic volume and typeof road. One site in each pair had a sign erected warning ofthe dangers of speeding and asking drivers to slow down. Noaction was taken at the second site. Three sets ofmeasurements were taken at each site. Each set of measurementswas nominally of the speeds of 100 cars, but not all siteshave exactly 100 measurements. These speed measurements weretaken before the erection of the sign, shortly after theerection of the sign, and again after the sign had been inplace for some time.
amldata.frameThe aml data framehas 23 rows and 3 columns. A clinical trial to evaluate theefficacy of maintenance chemotherapy for acute myelogenousleukemia was conducted by Embury et al. at StanfordUniversity. After reaching a stage of remission throughtreatment by chemotherapy, patients were randomized into twogroups. The first group received maintenance chemotherapy, andthe second group did not. The aim of the study was to see ifmaintenance chemotherapy increased the length of theremission. The data here formed a preliminary analysis thatwas conducted in October 1974.
beavertsThe beaver dataframe has 100 rows and 4 columns. It is a multivariate timeseries of class "ts" andalso inherits from class "data.frame". This data set is partof a long study into body temperature regulation in beavers.Four adult female beavers were live-trapped and had atemperature-sensitive radio transmitter surgically implanted.Readings were taken every 10 minutes. The location of thebeaver was also recorded, and her activity level wasdichotomized by whether she was in the retreat or outside ofit, since high-intensity activities only occur outside of theretreat. The data in this data frame comes from those readingsfor one of the beavers on a day in autumn.
bigcitydata.frameThe bigcity dataframe has 49 rows and 2 columns. The city data frame has 10 rows and 2columns. The measurements are the populations (in 1000s) of 49U.S. cities in 1920 and 1930. The 49 cities are a randomsample taken from the 196 largest cities in 1920. The city data frame consists of thefirst 10 observations in bigcity.
bramblesdata.frameThe brambles dataframe has 823 rows and 3 columns. The location of livingbramble canes in a 9-m square plot was recorded. We take 9 mto be the unit of distance so that the plot can be thought ofas a unit square. The bramble canes were also classified bytheir age.
breslowdata.frameThe breslow dataframe has 10 rows and 5 columns. In 1961, Doll and Hill sentout a questionnaire to all men on the British Medical Registerinquiring about their smoking habits. Almost 70% of the menreplied. Death certificates were obtained for medicalpractitioners, and causes of death were assigned on the basisof these certificates. The breslow data set contains theperson-years of observations and deaths from coronary arterydisease accumulated during the first 10 years of thestudy.
calciumdata.frameThe calcium dataframe has 27 rows and 2 columns. Howard Grimes of the BotanyDepartment, North Carolina State University, conducted anexperiment for biochemical analysis of intracellular storageand transport of calcium across plasma membrane. Cells weresuspended in a solution of radioactive calcium for a certainlength of time, and then the amount of radioactive calciumthat was absorbed by the cells was measured. The experimentwas repeated independently with nine different times ofsuspension each replicated three times.
canedata.frameThe cane data framehas 180 rows and 5 columns. The data frame represents arandomized block design with 45 varieties of sugarcane and 4blocks. The aim of the experiment was to classify thevarieties into resistant, intermediate, and susceptible to adisease called "coal of sugarcane" (carvao dacana-de-acucar). This is a disease that is commonin sugar-cane plantations in certain areas of Brazil. For eachplot, 50 pieces of sugarcane stem were put in a solutioncontaining the disease agent, and then some were planted inthe plot. After a fixed period of time, the total number ofshoots and the number of diseased shoots wererecorded.
capabilitydata.frameThe capability dataframe has 75 rows and 1 column. The data consists of simulatedsuccessive observations from a process in equilibrium. Theprocess is assumed to have specification limits (5.49, 5.79).
catsMdata.frameThe catsM data framehas 97 rows and 3 columns. One hundred and forty-four adult(over 2 kg in weight) cats used for experiments with the drugdigitalis had their heart and body weight recorded.Forty-seven of the cats were female, and 97 were male. ThecatsM data frame consistsof the data for the male cats. The full data can be found indata set \link[MASS]{cats}in package MASS.
cavdata.frameThe cav data framehas 138 rows and 2 columns. The data gives the positions ofthe individual caveolae in a square region with sides oflength 500 units. This grid was originally on a 2.65μm squareof muscle fiber. The data consist of those points falling inthe lower-left quarter of the region used for the data setcaveolae.dat.
cd4data.frameThe cd4 data framehas 20 rows and 2 columns. CD4 cells are carried in the bloodas part of the human immune system. One of the effects of thehuman immunodeficiency virus (HIV) is that these cells die.The count of CD4 cells is used in determining the onset offull-blown AIDS in a patient. In this study of theeffectiveness of a new antiviral drug on HIV, 20 HIV-positivepatients had their CD4 counts recorded and then were put on acourse of treatment with this drug. After using the drug for 1year, their CD4 counts were again recorded. The aim of theexperiment was to show that patients taking the drug hadincreased CD4 counts, which is not generally seen in HIV-positive patients.
cd4.nestedbootThis is an example of a nested bootstrap for thecorrelation coefficient of the cd4 data frame.
channingdata.frameThe channing dataframe has 462 rows and 5 columns. Channing House is aretirement center in Palo Alto, California. The data wascollected between the opening of the house in 1964 until July1, 1975. During that time, 97 men and 365 women passed throughthe center. For each of these, their age on entry and also onleaving or death was recorded. A large number of theobservations were censored mainly due to the resident beingalive on July 1, 1975, when the data was collected. Over thecourse of the study, 130 women and 46 men died at ChanningHouse. Differences between the survival of the sexes, takingage into account, was one of the primary concerns of thisstudy.
citydata.frameThe bigcity dataframe has 49 rows and 2 columns. The city data frame has 10 rows and 2columns. The measurements are the populations (in 1000s) of 49U.S. cities in 1920 and 1930. The 49 cities are a randomsample taken from the 196 largest cities in 1920. The city data frame consists of thefirst 10 observations in bigcity.
claridgedata.frameThe claridge dataframe has 37 rows and 2 columns. The data comes from anexperiment that was designed to look for a relationshipbetween a certain genetic characteristic and handedness. The37 subjects were women who had a son with mental retardationdue to inheriting a defective X-chromosome. For each suchmother, a genetic measurement of her DNA was made. Largervalues of this measurement are known to be linked to thedefective gene, and it was hypothesized that larger valuesmight also be linked to a progressive shift away fromright-handedness. Each woman also filled in a questionnaireregarding which hand she used for various tasks. From thesequestionnaires, a measure of hand preference was found foreach mother. The scale of this measure goes from 1, indicating women who alwaysfavor their right hand, to 8, indicating women who alwaysfavor their left hand. Between these two extremes are womenwho favor one hand for some tasks and the other for othertasks.
clothdata.frameThe cloth data framehas 32 rows and 2 columns.
co.transferdata.frameThe co.transfer dataframe has 7 rows and 2 columns. Seven smokers with chickenpoxhad their levels of carbon monoxide transfer measured uponbeing admitted to the hospital and then again after 1 week.The main question was whether 1 week of hospitalization hadchanged the carbon monoxide transfer factor.
coaldata.frameThe coal data framehas 191 rows and 1 column. This data frame gives the dates of191 explosions in coal mines that resulted in 10 or morefatalities. The time span of the data is from March 15, 1851, until March 22, 1962.
darwindata.frameThe darwin dataframe has 15 rows and 1 column. Charles Darwin conducted anexperiment to examine the superiority of cross-fertilizedplants over self-fertilized plants. Fifteen pairs of plantswere used. Each pair consisted of one cross-fertilized plantand one self-fertilized plant that germinated at the same timeand grew in the same pot. The plants were measured at a fixedtime after planting, and the differences in heights betweenthe cross- and self-fertilized plants were recorded in eighthsof an inch.
dogsdata.frameThe dogs data framehas 7 rows and 2 columns. Data on the cardiac oxygenconsumption and left ventricular pressure was gathered onseven domestic dogs.
downs.bcdata.frameThe downs.bc dataframe has 30 rows and 3 columns. Down's syndrome is a geneticdisorder caused by an extra chromosome 21 or a part ofchromosome 21 being translocated to another chromosome. Theincidence of Down's syndrome is highly dependent on themother's age and rises sharply after age 30. In the 1960s, alarge-scale study of the effect of maternal age on theincidence of Down's syndrome was conducted at the BritishColumbia Health Surveillance Registry. This data frameconsists of the data that was collected in that study. Motherswere classified by age. Most groups correspond to the age inyears, but the first group comprises all mothers aged 15–17and the last is those aged 46–49. No data for mothers over 50or below 15 was collected.
ducksdata.frameThe ducks data framehas 11 rows and 2 columns. Each row of the data framerepresents a male duck that is a second-generation crossbetween a mallard and a pintail. For 11 such ducks, abehavioral index and plumage index were calculated. These weremeasured on scales devised for this experiment, which was toexamine whether there was any link between which species theducks resembled physically and which they resembled inbehavior. The scale for physical appearance ranged from 0(identical in appearance to a mallard) to 20 (identical to apintail). The behavioral traits of the ducks were on a scaleof 0 to 15, with lower numbers indicating more mallard-likebehavior.
firdata.frameThe fir data framehas 50 rows and 3 columns. The number of balsam-fir seedlingsin each quadrant of a grid of 50 five-foot-square quadrantswere counted. The grid consisted of 5 rows of 10 quadrants ineach row.
fretsdata.frameThe frets data framehas 25 rows and 4 columns. The data consists of measurementsof the length and breadth of the heads of pairs of adultbrothers in 25 randomly sampled families. All measurements areexpressed in millimeters.
gravdata.frameThe gravity dataframe has 81 rows and 2 columns. The grav data set has 26 rows and 2columns. Between May 1934 and July 1935, the U.S. NationalBureau of Standards conducted a series of experiments toestimate the acceleration due to gravity, g, at Washington, DC. Each experimentproduced a number of replicate estimates ofg using the same methodology. Althoughthe basic method remained the same for all experiments, thatof the reversible pendulum, there were changes inconfiguration. The gravitydata frame contains the data from all eight experiments. Thegrav data frame containsthe data from experiments 7 and 8. The data is expressed asdeviations from 980.000 in centimeters per secondsquared.
gravitydata.frameThe gravity dataframe has 81 rows and 2 columns. The grav data set has 26 rows and 2columns. Between May 1934 and July 1935, the U.S. NationalBureau of Standards conducted a series of experiments toestimate the acceleration due to gravity, g, at Washington, DC. Each experimentproduced a number of replicate estimates ofg using the same methodology. Althoughthe basic method remained the same for all experiments, thatof the reversible pendulum, there were changes inconfiguration. The gravitydata frame contains the data from all eight experiments. Thegrav data frame containsthe data from experiments 7 and 8. The data is expressed asdeviations from 980.000 in centimeters per secondsquared.
hirosedata.frameThe hirose dataframe has 44 rows and 3 columns. PET film is used inelectrical insulation. In this accelerated life test, thefailure times for 44 samples in gas-insulated transformerswere estimated. Four different voltage levels wereused.
islaydata.frameThe islay data framehas 18 rows and 1 column. Measurements were taken of paleocurrent azimuths from theJura Quartzite on the Scottish island of Islay.
manaustsThe manaus timeseries is of class "ts" andhas 1, 080 observations on one variable. The data values aremonthly averages of the daily stages (heights) of the RioNegro at Manaus. Manaus is 18 km upstream from the confluenceof the Rio Negro with the Amazon but because of the tiny slopeof the water surface and the lower courses of its flatlandaffluents, they may be regarded as a good approximation of thewater level in the Amazon at the confluence. The data herecovers 90 years from January 1903 until December 1992. TheManaus gauge is tied in with an arbitrary benchmark of 100mset in the steps of the Municipal Prefecture; gauge readingsare usually referred to sea level, on the basis of a mark onthe steps leading to the Parish Church (Matriz), which isassumed to lie at an altitude of 35.874 m according toobservations made many years ago under the direction of SamuelPereira, an engineer in charge of the Manaus SanitationCommittee Whereas such an altitude cannot, by any means, beconsidered to be a precise datum point, observations have beenprovisionally referred to it. The measurements are inmeters.
melanomadata.frameThe melanoma dataframe has 205 rows and 7 columns. The data consists of measurements made on patientswith malignant melanoma. Each patient had his or her tumorsurgically removed at the Department of Plastic Surgery, University Hospital of Odense, Denmark, during the period1962–1977. The surgery consisted of complete removal of thetumor together with about 2.5 cm of the surrounding skin.Among the measurements taken were the thickness of the tumorand whether it was ulcerated or not. These are thought to beimportant prognostic variables in that patients with a thickand/or ulcerated tumor have an increased chance of death frommelanoma. Patients were followed until the end of1977.
motordata.frameThe motor data framehas 94 rows and 4 columns. The rows were obtained by removingreplicate values of timefrom the data set mcycle.Two extra columns were added to allow for strata with adifferent residual variance in each stratum.
neuromatrixneuro is a matrixcontaining times of observed firing of a neuron in windows of250 ms either side of the application of a stimulus to a humansubject. Each row of the matrix is a replication of theexperiment, and there are a total of 469 replicates.
nitrofendata.frameThe nitrofen dataframe has 50 rows and 5 columns. Nitrofen is a herbicide thatwas used extensively for the control of broad-leaved and grassweeds in cereals and rice. Although it is relatively nontoxicto adult mammals, nitrofen is a significant teratogen andmutagen. It is also acutely toxic and reproductively toxic tocladoceran zooplankton. Nitrofen is no longer incommercial use in the United States, having been the firstpesticide to be withdrawn due to teratogenic effects. The datahere comes from an experiment to measure the reproductivetoxicity of nitrofen on a species of zooplankton(Ceriodaphnia dubia). Fifty animals wererandomized into batches of 10, and each batch was put in asolution with a measured concentration of nitrofen. Then thenumber of live offspring in each of the three broods of eachanimal was recorded.
nodaldata.frameThe nodal data framehas 53 rows and 7 columns. The treatment strategy for apatient diagnosed with prostate cancer depends highly onwhether the cancer has spread to the surrounding lymph nodes.It is common to operate on the patient to get samples from thenodes, which can then be analyzed under a microscope, butclearly it would be preferable if an accurate assessment ofnodal involvement could be made without surgery. For a sampleof 53 prostate cancer patients, a number of possible predictorvariables were measured before surgery. The patients then hadsurgery to determine nodal involvement. The point of the studywas to see if nodal involvement could be accurately predictedfrom the predictor variables and which ones were mostimportant.
nucleardata.frameThe nuclear dataframe has 32 rows and 11 columns. The data relates to theconstruction of 32 light-water reactor (LWR) plantsconstructed in the United States in the late 1960s and early1970s. The data was collected with the aim of predicting thecost of construction of additional LWR plants. Six of thepower plants had partial turnkey guarantees, and it ispossible that, for these plants, some manufacturers' subsidiesmay be hidden in the quoted capital costs.
paulsendata.frameThe paulsen dataframe has 346 rows and 1 column. Sections were prepared fromthe brain of adult guinea pigs. Spontaneous currents thatflowed into individual brain cells were then recorded and thepeak amplitude of each current measured. The aim of theexperiment was to see if the current flow was quantal innature (i.e., that it is not a single burst but instead isbuilt up of many smaller bursts of current). If the currentwas indeed quantal, then it would be expected that thedistribution of the current amplitude would be multimodal withmodes at regular intervals. The modes would be expected todecrease in magnitude for higher current amplitudes.
poisonsdata.frameThe poisons dataframe has 48 rows and 3 columns. The data form a 3 × 4factorial experiment, the factors being three poisons and fourtreatments. Each combination of the two factors was used onfour animals, the allocation to animals having been completelyrandomized.
polardata.frameThe polar data framehas 50 rows and 2 columns. The data consists of the polepositions from a paleomagnetic study of New Caledonianlaterites.
remissiondata.frameThe remission dataframe has 27 rows and 3 columns.
salinitydata.frameThe salinity dataframe has 28 rows and 4 columns. Biweekly averages of thewater salinity and river discharge in Pamlico Sound, NorthCarolina, were recorded between the years 1972 and 1977. Thedata in this set consists only of those measurements in March, April, and May.
survivaldata.frameThe survival dataframe has 14 rows and 2 columns. The data measured thesurvival percentages of batches of rats who were given varyingdoses of radiation. At each of six doses there were two orthree replications of the experiment.
taudata.frameThe tau data framehas 60 rows and 2 columns. The tau particle is a heavyelectron-like particle discovered in the 1970s by Martin Perlat the Stanford Linear Accelerator Center. Soon after itsproduction, the tau particle decays into various collectionsof more stable particles. About 86% of the time, the decayinvolves just one charged particle. This rate has beenmeasured independently 13 times. The one-charged-particleevent is made up of four major modes of decay as well as acollection of other events. The four main types of decay aredenoted rho, pi, e, and mu. These rates have been measuredindependently 6, 7, 14, and 19 times, respectively. Due tophysical constraints, each experiment can only estimate thecomposite one-charged-particle decay rate or the rate of oneof the major modes of decay. Each experiment consists of amajor research project involving many years' work. One of thegoals of the experiments was to estimate the rate of decay dueto events other than the four main modes of decay. These areuncertain events and so cannot themselves be observeddirectly.
tunadata.frameThe tuna data framehas 64 rows and 1 column. The data comes from an aerial linetransect survey of southern bluefin tuna in the GreatAustralian Bight. An aircraft with two spotters on board flewrandomly allocated line transects. Each school of tuna sightedwas counted and its perpendicular distance from the transectmeasured. The survey was conducted in summer when tuna tend tostay on the surface.
urinedata.frameThe urine data framehas 79 rows and 7 columns. Seventy-nine urine specimens wereanalyzed in an effort to determine if certain physicalcharacteristics of the urine might be related to the formationof calcium oxalate crystals.
wooltswool is a timeseries of class "ts" andcontains 309 observations. Each week that the market was open, the Australian Wool Corporation set a floor price thatdetermined its policy on intervention and was therefore areflection of the overall price of wool for the week inquestion. Actual prices paid varied considerably about thefloor price. The series here is the log of the ratio betweenthe price for fine-grade wool and the floor price, each marketweek between July 1976 and June 1984.

class

This package provides functions for classification.

Functions

FunctionDescription
SOM, batchSOMKohonen's self-organizing maps (SOMs) are a crude formof multidimensional scaling.
condenseCondenses training set fork-nearest-neighbor(k-NN) classifier.
knnk-nearest-neighbor classificationfor test set from training set. For each row of the test set, the k-nearest (in Euclideandistance) training set vectors are found, and theclassification is decided by majority vote, with ties brokenat random. If there are ties for the kth nearest vector, allcandidates are included in the vote.
knn.cvk-nearest-neighborcross-validatory classification from training set.
knn1Nearest-neighbor classification for test set fromtraining set. For each row of the test set, the nearestneighbor (by Euclidean distance) training set vector is found, and its classification used. If there is more than one nearestneighbor, a majority vote is used, with ties broken atrandom.
lvq1, lvq2, lvq3Moves examples in a codebook to better represent thetraining set.
lvqinitConstructs an initial codebook for learning vectorquantization (LVQ) methods.
lvqtestClassifies a test set by 1-NN from a specified LVQcodebook.
multieditMultiedit for k-NNclassifier.
olvq1Moves examples in a codebook to better represent thetraining set.
reduce.nnReduces training set for a k-NNclassifier. Used after condense.
somgridPlotting functions for SOM results.

cluster

This package provides functions for clusteranalysis.

Functions

FunctionDescription
agnesComputes agglomerative hierarchical clustering of thedata set.
bannerplotDraws a "banner, " i.e., basically a horizontal barplot visualizing the(agglomerative or divisive) hierarchical clustering or another binary dendrogram structure.
claraComputes a "clara"object, a list representing a clustering of the data intokclusters.
clusplotDraws a two-dimensional (2D) "clusplot" on the currentgraphics device.
coef.hclustComputes the "agglomerative coefficient, " measuring theclustering structure of the data set.
daisyComputes all the pairwise dissimilarities (distances)between observations in the data set.
dianaComputes a divisive hierarchical clustering of the dataset, returning an object of class diana.
ellipsoidPointsComputes points on the ellipsoid boundary, mostly fordrawing.
ellipsoidhullComputes the "ellipsoid hull" or "spanning ellipsoid, "i.e., the ellipsoid of minimal volume ("area" in 2D) such thatall given points lie just inside or on the boundary of theellipsoid.
fannyComputes a fuzzy clustering of the data intokclusters.
lower.to.upper.tri.indsComputes index vectors for extracting or reordering oflower or upper triangular matrices that are stored ascontiguous vectors.
monaReturns a list representing a divisive hierarchicalclustering of a data set with binary variables only.
pamPartitioning (clustering) of the data intokclusters "around medoids, " a more robust version ofk-means clustering.
pltreeGeneric function drawing a clustering tree ("dendrogram") on the currentgraphics device. There is a twins method; see pltree.twins for usage andexamples.
predict.ellipsoidComputes points on the ellipsoid boundary, mostly fordrawing.
silhouetteComputes silhouette information according to a givenclustering in k clusters.
sizeDissReturns the number of observations (samplesize) corresponding to a dissimilarity-like objector, equivalently, the number of rows or columns of a matrixwhen only the lower or upper triangular part (withoutdiagonal) is given. It is nothing else but the inversefunction of f(n)= n(n −1)/2.
sortSilhouetteComputes silhouette information according to a givenclustering in k clusters.
upper.to.lower.tri.indsComputes index vectors for extracting or reordering oflower or upper triangular matrices that are stored ascontiguous vectors.
volumeComputes the volume of a planar object. This is ageneric function and a method for ellipsoid objects.

Data Sets

Data SetClassDescription
agriculturedata.frameGross national product (GNP) per capita and percentageof the population working in agriculture for each countrybelonging to the European Union in 1993.
animalsdata.frameThis data set considers 6 binary attributes for 20animals.
chorSubmatrixThis is a small rounded subset of the C-horizondata.
flowerdata.frameThis data set consists of 8 characteristics for 18popular flowers.
plantTraitsdata.frameThis data set constitutes a description of 136 plantspecies according to biological attributes (morphological orreproductive).
plutondata.frameThe pluton dataframe has 45 rows and 4 columns, containing percentages ofisotopic composition of 45 plutonium batches.
ruspinidata.frameThe Ruspini data set, consisting of 75 points in 4groups, is popular for illustrating clustering techniques.
votes.repubdata.frameA data frame with the percents of votes given to theRepublican candidates in presidential elections from 1856 to1976. Rows represent the 50 states, and columns the 31elections.
xclaradata.frameAn artificial data set consisting of 3, 000 points in 3well-separated clusters of size 1, 000 each.

codetools

This package provides tools for analyzing R code. It ismainly intended to support the other tools in this package and byte codecompilation. See the help file for more information.

foreign

This package provides functions for reading data stored byMinitab, S, SAS, SPSS, Stata, Systat, dBase, and so forth.

Functions

FunctionDescription
data.restoreReads binary data files or data.dump files that were producedin S version 3.
lookup.xportScans a file as a SAS XPORT format library and returnsa list containing information about the SAS library.
read.SReads binary data files or data.dump files that were producedin S version 3.
read.arffReads data from Weka Attribute-Relation File Format(ARFF) files.
read.dbfReads a DBF file into a data frame, convertingcharacter fields to factors and trying to respect NULL fields.
read.dtaReads a file in Stata version 5–10 binary format into adata frame.
read.epiinfoReads data files in the .REC format used by Epi Infoversions 6 and earlier and by EpiData. Epi Info is apublic-domain database and statistics package produced by theU.S. Centers for Disease Control and Prevention, and EpiDatais a freely available data entry and validationsystem.
read.mtpReturns a list with the data stored in a file as aMinitab Portable Worksheet.
read.octaveReads a file in Octave text data format into alist.
read.spssReads a file stored by the SPSS save or export commands.
read.ssdGenerates a SAS program to convert the ssd contents toSAS transport format and then uses read.xport to obtain a dataframe.
read.systatReads a rectangular data file stored by the SystatSAVE command as (legacy)*.sys or, more recently, *.syd files.
read.xportReads a file as a SAS XPORT format library and returnsa list of data.frames.
write.arffWrites data into Weka Attribute-Relation File Format(ARFF) files.
write.dbfTries to write a data frame to a DBF file.
write.dtaWrites the data frame to file in the Stata binaryformat. Does not write array variables unless they can bedrop-ed to avector.
write.foreignExports simple data frames to other statisticalpackages by writing the data as free-format text and writing aseparate file of instructions for the other package to readthe data.

grDevices

This package provides functions for graphics devices andsupport for base and grid graphics.

Functions

FunctionDescription
CIDFontUsed to define the translation of an R graphics fontfamily name to a Type 1 or CID font description, used by both thepostscript and the pdf graphics devices.
Type1FontUsed to define the translation of an R graphics fontfamily name to a Type 1 or CID font description, used by both thepostscript and the pdf graphics devices.
X11Starts a graphics device driver for the X Window System(version 11). This can only be done on machines/accounts thathave access to an X server.
X11.optionsSets options for an X11 device.
X11Font, X11FontsHandle the translation of a device-independent Rgraphics font family name to an X11 font description.
as.graphicsAnnotCoerces an R object into a form suitable for graphicsannotation.
bitmapGenerates a graphics file. dev2bitmap copies the currentgraphics device to a file in a graphics format.
bmpGraphics device for generating BMP(bitmap)files.
boxplot.statsThis function is typically called by another functionto gather the statistics necessary for producing box plots, but may be invoked separately.
cairo_pdfA Cairo-based graphics device for generating PDFfiles.
cairo_psA Cairo-based graphics device for generating PostScriptfiles.
check.optionsUtility function for setting options with someconsistency checks. The attributes of the new settings innew are checked forconsistency with the model (oftendefault) list in name.opt.
chullComputes the subset of points that lie on the convexhull of the set of points specified.
cmTranslates from inches to centimeters (cm).
cm.colorsCreates a vector of n contiguouscolors.
col2rgbR color to RGB (red/green/blue) conversion.
colorConverterSpecifies color spaces for use in convertColor.
colorRamp, colorRampPaletteThese functions return functions that interpolate a setof given colors to create new color palettes (like topo.colors) and color ramps, functions that map the interval [0, 1] to colors (likegray).
colors, coloursReturns the built-in color names that R knowsabout.
contourLinesCalculates contour lines for a given set ofdata.
convertColorConverts colors between standard color spacerepresentations. This function is experimental.
densColsProduces a vector containing colors that encode thelocal densities at each point in a scatter plot.
dev.controlAllows the user to control the recording of graphicsoperations in a device.
dev.copyCopies the graphics contents of the current device tothe device specified by which or to a new device that hasbeen created by the function specified by device (it is an error to specifyboth which and device).
dev.copy2epsCopies the graphics contents of the current device toan Encapsulated PostScript Format (EPSF) output file inportrait orientation (horizontal =FALSE).
dev.copy2pdfCopies the graphics contents of the current device to aPDF output file in portrait orientation (horizontal = FALSE).
dev.curReturns a named integer vector of length 1, giving thenumber and name of the active device, or 1, the null device, if none is active.
dev.interactiveTests if the current graphics device (or that whichwould be opened) is interactive.
dev.listReturns the numbers of all open devices, except device1, the null device. This is a numeric vector with a namesattribute giving the device names, or NULL if there is no opendevice.
dev.newOpens a new graphics device.
dev.nextReturns the number and name of the next device in thelist of devices.
dev.offShuts down the specified (by default the current)graphics device.
dev.prevReturns the number and name of the previous device inthe list of devices.
dev.printCopies the graphics contents of the current device to anew device that has been created by the function specified bydevice and then shuts thenew device.
dev.setMakes the specified graphics device the activedevice.
dev.sizeFinds the dimensions of the device surface of thecurrent device.
dev2bitmapbitmap generates agraphics file. dev2bitmapcopies the current graphics device to a file in a graphicsformat.
devAskNewPageUsed to control (for the current device) whether theuser is prompted before starting a new page of output.
deviceIsInteractiveTests if the current graphics device (or that whichwould be opened) is interactive.
embedFontsRuns Ghostscript to process a PDF or PostScript fileand embed all fonts in the file.
extendrangeExtends a numeric range by a small percentage, i.e., fraction, on both sides.
getGraphicsEventWaits for input from a graphics window in the form of amouse or keyboard event.
graphics.offProvides control over multiple graphicsdevices.
grayCreates a vector of colors from a vector of graylevels.
gray.colorsCreates a vector of n gamma-corrected graycolors.
greyCreates a vector of colors from a vector of graylevels.
grey.colorsCreates a vector of n gamma-corrected graycolors.
hclCreates a vector of colors from vectors specifying hue, chroma, and luminance.
heat.colorsCreates a vector of n contiguous colors.
hsvCreates a vector of colors from vectors specifying hue, saturation, and value.
jpegCreates a graphics device for generating JPEG formatfiles.
make.rgbSpecifies color spaces for use in convertColor.
n2mfrowEasy setup for plotting multiple figures (in arectangular layout) on one page. This computes a sensibledefault for par(mfrow).
nclass.FDComputes the number of classes for a histogram usingthe Freedman-Diaconis choice based on the interquartile range(IQR), unless that's 0, where it reverts to mad(x, constant = 2), and when thatis 0 as well, returns 1.
nclass.SturgesComputes the number of classes for a histogram usingSturges's formula, implicitly basing bin sizes on the range ofthe data.
nclass.scottComputes the number of classes for a histogram usingScott's choice for a normal distribution based on the estimateof the standard error, unless that is 0 where it returns1.
paletteViews or manipulates the color palette that is usedwhen a col= has a numericindex.
pdfStarts the graphics device driver for producing PDFgraphics.
pdf.optionsThe auxiliary function pdf.options can be used to set orview (if called without arguments) the default values for someof the arguments to pdf.
pdfFontsLists existing mapping for PDF fonts or creates newmappings.
pictexProduces graphics suitable for inclusion in TeX andLaTeX documents.
pngCreates a new graphics device for producing PortableNetwork Graphics (PNG) files.
postscriptStarts the graphics device driver for producingPostScript graphics.
postscriptFontsLists existing mapping for PostScript fonts or createsnew mappings.
ps.optionsThe auxiliary function ps.options can be used to set orview (if called without arguments) the default values for someof the arguments to postscript.
quartzStarts a graphics device driver for the Mac OS Xsystem.
quartz.optionsSets options for a quartz device.
quartzFontTranslates from a device-independent R graphics fontfamily name to a quartz font description.
quartzFontsLists existing mappings of device-independent Rgraphics to a quartz font description, or defines newmappings.
rainbowCreates a vector of n contiguous colors.
recordGraphicsRecords arbitrary code on the graphics engine displaylist. Useful for encapsulating calculations with graphicaloutput that depends on the calculations. Intendedonly for expert use.
recordPlot, replayPlotFunctions to save the current plot in an R variable andto replay it.
rgbCreates colors corresponding to the given intensities(between 0 and max) of thered, green, and blue primaries.
rgb2hsvTransforms colors from RGB space (red/green/blue) intoHSV space (hue/saturation/value).
savePlotSaves the current page of a Cairo X11() device to afile.
setEPSA wrapper to ps.options that sets defaults appropriatefor figures for inclusion in documents (the default size is 7inches square unless width or height is supplied).
setPSA wrapper to ps.options to set defaults appropriate forfigures for spooling to a PostScript printer.
svgCreates a new graphics device for outputting graphicsin Scalable Vector Graphics (SVG) format.
terrain.colorsCreates a vector of n contiguous colors.
tiffCreates a new graphics device for outputting graphicsin Tagged Image File Format (TIFF) format.
topo.colorsCreates a vector of n contiguous colors.
trans3dProjection of three-dimensional to two-dimensionalpoints using a 4 × 4 viewing transformation matrix.
x11A synonym for X11 (which opens a new X11 device forplotting graphics).
xfigStarts the graphics device driver for producing XFig(version 3.2) graphics.
xy.coordsUsed by many functions to obtain x and y coordinatesfor plotting. The use of this common mechanism across allrelevant R functions produces a measure ofconsistency.
xyTableGiven (x, y) points, determines theirmultiplicity—checking for equality only up to some (crude kindof) noise. Note that this is a special kind of 2Dbinning.
xyz.coordsUtility for obtaining consistent x, y, and zcoordinates and labels for three-dimensional (3D)plots.

Data Sets

Data SetClassDescription
HersheylistIf the familygraphical parameter (see par) has been set to one of theHershey fonts, Hershey vector fonts are used to render text.When using the text andcontour functions, Hersheyfonts may be selected via the vfont argument, which is a charactervector of length 2. This allows Cyrillic to be selected, whichis not available via the font families.
blues9characterdensCols produces avector containing colors that encode the local densities ateach point in a scatter plot.
colorspaceslistConverts colors between standard color spacerepresentations. This function is experimental.

graphics

This package contains functions for base graphics. Basegraphics are traditional S graphics, as opposed to the newer gridgraphics.

Functions

FunctionDescription
AxisGeneric function to add a suitable axis to the currentplot.
ablineAdds one or more straight lines through the currentplot.
arrowsDraws arrows between pairs of points.
assocplotProduces a Cohen-Friendly association plot indicatingdeviations from independence of rows and columns in atwo-dimensional contingency table.
axTicksComputes pretty tick mark locations, the same way as Rdoes internally. This is only nontrivial whenlog coordinates are active. By default, gives the at values thataxis(side) woulduse.
axisAdds an axis to the current plot, allowing thespecification of the side, position, labels, and otheroptions.
barplotCreates a bar plot with vertical or horizontalbars.
boxDraws a box around the current plot in a given colorand line type. The btyparameter determines the type of box drawn. See par for details.
boxplotProduces box-and-whisker plot(s) of the given (grouped)values.
boxplot.matrixInterprets the columns (or rows) of a matrix asdifferent groups and draws a box plot for each.
bxpDraws box plots based on the given summaries inz. It is usually calledfrom within boxplot, butcan be invoked directly.
cdplotComputes and plots conditional densities describing howthe conditional distribution of a categorical variabley changes over a numericvariable x.
clipSets clipping region in user coordinates.
close.screenRemoves the specified screen definition(s) created bysplit.screen.
co.intervalsProduces two variants of theconditioning plots.
contourCreates a contour plot or adds contour lines to anexisting plot. Methods include contour.default.
coplotProduces two variants of theconditioning plots.
curveDraws a curve corresponding to a given function or, forcurve(), also an expression(in x) over the interval[from, to].
dotchartDraws a Cleveland dot plot.
erase.screenUsed to clear a single screen (when using split.screen), which it does byfilling with the background color.
filled.contourProduces a contour plot with the areas between thecontours filled in solid color (Cleveland calls this a levelplot).
fourfoldplotCreates a fourfold display of a2-by-2-by-k contingency table on thecurrent graphics device, allowing for the visual inspection ofthe association between two dichotomous variables in one orseveral populations (strata).
frameThis function (frameis an alias for plot.new)causes the completion of plotting in the current plot (ifthere is one) and an advance to a new graphics frame.
grconvertX, grconvertYConvert between graphics coordinate systems.
gridAdds an nx-by-ny rectangular grid to an existingplot.
histThe generic function hist computes a histogram of thegiven data values. If plot=TRUE, the resulting object of\link[base]{class"histogram"} is plotted by plot.histogram, before it isreturned. Methods include hist.default.
identifyReads the position of the graphics pointer when the(first) mouse button is pressed. It then searches thecoordinates given in x andy for the point closest tothe pointer. If this point is close enough to the pointer, itsindex will be returned as part of the value of thecall.
imageCreates a grid of colored or grayscale rectangles withcolors corresponding to the values in z.
layout, layout.showlayout divides thedevice up into as many rows and columns as there are in matrixmat, with the column widthsand the row heights specified in the respective arguments.
lcmlayout divides thedevice up into as many rows and columns as there are in matrixmat, with the column widthsand the row heights specified in the respective arguments.
legendUsed to add legends to plots. Note that a call to thefunction locator(1) can beused in place of the x andy arguments.
linesA generic function taking coordinates given in variousways and joining the corresponding points with line segments.Methods include lines.default and lines.ts.
locatorReads the position of the graphics cursor when the(first) mouse button is pressed.
matlines, matplot, matpointsPlot the columns of one matrix against the columns ofanother.
mosaicplotPlots a mosaic on the current graphics device.
mtextText is written in one of the four margins of thecurrent figure region or one of the outer margins of thedevice region.
pairsA matrix of scatter plots is produced.
panel.smoothAn example of a simple useful panel function to be used as anargument in, e.g., coplotor pairs.
parUsed to set or query graphical parameters.
perspDraws perspective plots of surfaces over thexy plane.
pieDraws a pie chart.
plotGeneric function for plotting R objects.
plot.designPlots univariate effects of one or more factors, typically for a designedexperiment as analyzed by aov().
plot.newThis function (plot.new is an alias for frame) causes the completion ofplotting in the current plot (if there is one) and an advanceto a new graphics frame.
plot.windowSets up the world coordinate system for a graphicswindow. It is called by higher-level functions such asplot.default(after plot.new).
plot.xyThis is the internal function thatdoes the basic plotting of points and lines. Usually, oneshould rather use the higher-level functions instead and referto their help pages for explanation of the arguments.
pointsA generic function to draw a sequence of points at thespecified coordinates. The specified character(s) are plotted, centered at the coordinates. Methods include points.default.
polygonDraws the polygons whose vertices are given in x and y.
rectDraws a rectangle (or sequence of rectangles) with thegiven coordinates, fill, and border colors.
rugAdds a rug representation (1Dplot) of the data to the plot.
screenUsed to select which screen to draw in (when usingsplit.screen).
segmentsDraws line segments between pairs of points.
smoothScatterProduces a smoothed color density representation of thescatter plot, obtained through a kernel densityestimate.
spineplotSpine plots are a special case of mosaic plots and canbe seen as a generalization of stacked (or highlighted) barplots. Analogously, spinograms are an extension ofhistograms.
split.screenDefines a number of regions within the current devicethat can, to some extent, be treated as separate graphicsdevices. It is useful for generating multiple plots on asingle device.
starsDraws star plots or segment diagrams of a multivariatedata set. With one single location, also draws "spider" (or"radar") plots.
stemProduces a stem-and-leaf plot of the values in x.
strheightComputes the height of the given strings ormathematical expressions s[i] on the current plotting devicein user coordinates, inches, or as a fraction of the figurewidth par("fin").
stripchartProduces one-dimensional scatter plots (or dot plots)of the given data. These plots are a good alternative to boxplots when sample sizes are small.
strwidthComputes the width of the given strings or mathematicalexpressions s[i] on thecurrent plotting devicein user coordinates, inches, or as a fraction of the figurewidth par("fin").
sunflowerplotMultiple points are plotted as "sunflowers" withmultiple leaves ("petals") such that overplotting isvisualized instead of accidental and invisible.
symbolsDraws symbols on a plot. One of six symbols, circles, squares, rectangles, stars, thermometers, and boxplots, can be plotted at a specified set of x and ycoordinates.
textDraws the strings given in the vector labels at the coordinates given byx and y. y may be missing since xy.coords(x, y) is used forconstruction of the coordinates.
titleUsed to add labels to a plot.
xinch, xyinch, yincchxinch and yinch convert the specified numberof inches given as their arguments into the correct units forplotting with graphics functions. Usually, this only makessense when normal coordinates are used, i.e., no logscale (see the log argumentto par). xyinch does the same for a pair ofnumbers xy, simultaneously.
xsplineDraws an X-spline, a curve drawn relative to controlpoints.

grid

This package is a low-level graphics system that providesa great deal of control and flexibility in the appearance and arrangementof graphical output. It does not provide high-level functions thatcreate complete plots. What it does provide is a basis for developingsuch high-level functions (e.g., the lattice package), the facilities forcustomizing and manipulating lattice output, the ability to producehigh-level plots or non-statistical images from scratch, and the abilityto add sophisticated annotations to the output from base graphicsfunctions (see the gridBase package).For more information, see the help files for grid.

KernSmooth

This package provides functions for kernelsmoothing.

Functions

FunctionDescription
bkdeReturns x andy coordinates of the binned kerneldensity estimate of the probability density of thedata.
bkde2DReturns the set of grid points in each coordinatedirection, and the matrix of density estimates over the meshinduced by the grid points. The kernel is the standardbivariate normal density.
bkfeReturns an estimate of a binned approximation to thekernel estimate of the specified density function. The kernelis the standard normal density.
dpihUses direct plug-in methodology to select the bin widthof a histogram.
dpikUses direct plug-in methodology to select the bandwidthof a kernel density estimate.
dpillUses direct plug-in methodology to select the bandwidthof a local linear Gaussian kernel regression estimate.
locpolyEstimates a probability density function, regressionfunction, or their derivatives using local polynomials. A fastbinned implementation over an equally spaced grid isused.

lattice

Trellis graphics is a framework for data visualizationdeveloped at Bell Labs by Richard Becker, William Cleveland, et al., extending ideas presented inBill Cleveland's 1993 book Visualizing Data.

Lattice is best thought of as an implementation of Trellisgraphics for R. It is built upon the grid graphics engine and requiresthe grid add-on package. It is not (readily) compatible with traditionalR graphics tools. The public interface is based on the implementation inS-PLUS, but features several extensions, in addition toincompatibilities introduced through the use of grid. To the extentpossible, care has been taken to ensure that existing Trellis codewritten for S-PLUS works unchanged (or with minimal change) in lattice.If you are having problems porting S-PLUS code, read the entry for panelin the documentation for xyplot. Mosthigh-level Trellis functions in S-PLUS are implemented, with theexception of piechart.

Functions

FunctionDescription
RowsConvenience function to extract a subset of a list.Usually used in creating keys.
as.shingle, as.factorOrShingleFunctions to handle shingles.
axis.defaultDefault function for drawing axes in latticeplots.
bankingCalculates banking slope.
barchartDraws bar charts.
bwplotDraws box plots.
canonical.themeInitialization of a display device with appropriategraphical parameters.
cloudGeneric function to draw 3D scatter plots and surfaces.The "formula" methods domost of the actual work.
col.whitebgInitialization of a display device with appropriategraphical parameters.
contourplotDraws level plots and contour plots.
current.columnReturns an integer index specifying which column in thelayout is currently active.
current.panel.limitsUsed to retrieve a panel's x and y limits.
current.rowReturns an integer index specifying which row in thelayout is currently active.
densityplotDraws histograms and kernel density plots, possiblyconditioned on other variables.
diag.panel.splomThis is the default superpanel function for splom.
do.breaksDraws histograms and kernel density plots, possiblyconditioned on other variables.
dotplotDraws Cleveland dot plots.
draw.colorkeyProduces (and possibly draws) a grid frame grob, whichis a color key that can be placed in other grid plots. Used inlevelplot.
draw.keyProduces (and possibly draws) a grid frame grob, whichis a legend (aka key) that can be placed in other gridplots.
equal.countFunction to handle shingles.
histogramDraws histograms and kernel density plots, possiblyconditioned on other variables.
is.shingleFunction to handle shingles.
larrows, llines, lplot.xy, lpoints, lpolygon, lrect, lsegments, ltext, panel.points, panel.polygon, panel.rect, panel.segments, panel.textThese functions are intended to replace commonlow-level traditional graphics functions, primarily for use inpanel functions. The originals cannot be used (at least noteasily) because lattice panel functions need to use gridgraphics. Low-level drawing functions in grid can be useddirectly as well and are often more flexible. These functionsare provided for convenience and portability.
lattice.getOption, lattice.optionsFunctions to handle settings used by lattice. Theirmain purpose is to make code maintenance easier, and usersnormally should not need to use these functions. However, finecontrol at this level may be useful in certain cases.
latticeParseFormulaUsed by high-level lattice functions like xyplot to parse the formula argumentand evaluate various components of the data.
level.colorsCalculates false colors from a numeric variable(including factors, using their numeric codes) given a colorscheme and break points.
levelplotDraws level plots and contour plots.
ltransform3dMatrix, ltransform3dto3dThese are (related to) the default panel functions forcloud and wireframe.
make.groupsCombines two or more vectors, possibly of differentlengths, producing a data frame with a second columnindicating which of these vectors that row came from. This ismostly useful for getting data into a form suitable for use inhigh-level lattice functions.
onewayFits a one-way model to univariate data grouped by afactor, the result often being displayed using rfs.
packet.numberA function that identifies which packet eachobservation in the data is part of.
packet.panel.defaultDefault function in lattice to determine, given thecolumn, row, page, and other relevant information, the packet(if any) that should be used in a panel.
panel.3dscatter, panelDefault panel functions controlling cloud and wireframe displays.
panel.ablineAdds a line of the form y = a + bxor vertical and/or horizontal lines.
panel.averageTreats one of x andy as a factor (according to the value ofhorizontal), calculates fun applied to the subsets of theother variable determined by each unique value of the factor, and joins them by a line.
panel.arrowsDraws arrows in a panel.
panel.axisThe function used by lattice to draw axes. It istypically not used by users, except those wishing to createadvanced annotation. Keep in mind issues of clipping whentrying to use it as part of the panel function. current.panel.limits can be used toretrieve a panel's x andy limits.
panel.barchartDefault panel function for barchart.
panel.brush.splompanel.link.splom ismeant for use with splom and requires a panel to be chosenusing trellis.focus beforeit is called. Clicking on a point causes that and thecorresponding projections in other pairwise scatter plots tobe highlighted.
panel.bwplotDefault panel function for bwplot.
panel.cloudDefault panel function controlling cloud and wireframe displays.
panel.contourplotDefault panel function for levelplot.
panel.curveAdds a curve, similar to what curve does with add=TRUE. Graphical parameters forthe line are obtained from the add.line setting.
panel.densityplotDefault panel function for densityplot.
panel.dotplotDefault panel function for dotplot.
panel.errorDefault handler used when an error occurs whileexecuting a panel function.
panel.fillFills the panel with a specified color.
panel.gridDraws a reference grid.
panel.histogramDefault panel function for histogram.
panel.identifySimilar to identify. When called, it waits for the userto identify points (in the panel being drawn) via mouseclicks.
panel.levelplotDefault panel function for levelplot.
panel.linejoinpanel.linejoin is analias for panel.averagethat was retained for back-compatibility and may go away inthe future.
panel.linesPlots lines in a panel.
panel.link.splomThe classic Trellis paradigm is to plot the wholeobject at once, without the possibility of interacting with itafterward. However, by keeping track of the grid viewportswhere the panels and strips are drawn, it is possible to goback to them afterward and enhance them one panel at a time.This function provides convenient interfaces to help in this.Note that this is still experimental and the exact details maychange in the future.
panel.lmlinepanel.lmline(x, y)is equivalent to panel.abline(lm(y~x)).
panel.loessAdds a smooth curve (fitted by loess).
panel.mathdensityPlots a (usually theoretical) probability densityfunction.
panel.numberReturns an integer counting which panel is being drawn(starting from 1 for the first panel, aka the panelorder).
panel.pairsDefault superpanel function for splom.
panel.parallelDefault panel function for parallel.
panel.qqDefault panel function for qq.
panel.qqmathDefault panel function for qqmath.
panel.qqmathlineUseful panel function with qqmath. Draws a line passing throughthe points (usually) determined by the .25 and .75 quantilesof the sample and the theoretical distribution.
panel.reflineSimilar to panel.abline, but uses the"reference.line" settings for the defaults.
panel.rugAdds a rug representation of the (marginal) data to thepanel.
panel.smoothScatterAllows the user to place smoothScatter plots in latticegraphics.
panel.splomDefault panel function for splom.
panel.stripplotDefault panel function for stripplot. Also see panel.superpose.
panel.superpose, panel.superpose.2These are panel functions for Trellis displays, whichare useful when a grouping variable is specified for usewithin panels. The x (andy where appropriate)variables are plotted with different graphical parameters foreach distinct value of the grouping variable.
panel.tmd.default, panel.tmd.qqmathDefault panel functions for tmd.
panel.violinThis is a panel function that can create a violin plot.It is typically used in a high-level call to bwplot.
panel.wireframeDefault panel functions controlling cloud and wireframe displays.
panel.xyplotDefault panel function for xyplot.
parallelDraws conditional scatter plot matrices and parallelcoordinate plots.
prepanel.default.bwplot, prepanel.default.cloud, prepanel.default.densityplot, prepanel.default.histogram, prepanel.default.levelplot, prepanel.default.parallel, prepanel.default.qq, prepanel.default.qqmath, prepanel.default.splom, prepanel.default.xyplotThese prepanel functions are used as fallback defaultsin various high-level plot functions in lattice. These arerarely useful to normal users, but may be helpful indeveloping new displays.
prepanel.lmline, prepanel.loess, prepanel.qqmathlineThese are predefined prepanel functions available inlattice.
prepanel.tmd.default, prepanel.tmd.qqmathtmd creates Tukeymean-difference plots from a trellis object returned by xyplot, qq, or qqmath. The prepanel and panelfunctions are used as appropriate. The formula method for tmd is provided for convenience andsimply calls tmd on theobject created by calling xyplot on that formula.
qqQuantile-quantile plots for comparing twodistributions.
qqmathQuantile-quantile plot of a sample and a theoreticaldistribution.
rfsPlots fitted values and residuals (via qqmath) on a common scale for anyobject that has methods for fitted values andresiduals.
shingleFunction to handle shingle.
show.settingsFunction used to query, display, and modify graphicalparameters for fine control of Trellis displays. Modificationsare made to the settings for the currently active deviceonly.
simpleKeySimple interface to generate a list appropriate fordraw.key.
simpleThemeSimple interface to generate a list appropriate as atheme, typically used as the par.settings argument in ahigh-level call.
splomDraws conditional scatter plot matrices and parallelcoordinate plots.
standard.themeInitialization of a display device with appropriategraphical parameters.
strip.customProvides a convenient way to obtain new strip functionsthat differ from strip.default only in the defaultvalues of certain arguments.
strip.defaultFunction that draws the strips by default in Trellisplots. Users can write their own strip functions, but mostcommonly this involves calling strip.default with slightlydifferent arguments.
stripplotDraws strip plots in lattice.
tmdtmd creates Tukeymean-difference plots from a trellis object returned by xyplot, qq, or qqmath. The formula method for tmd is provided for convenience andsimply calls tmd on theobject created by calling xyplot on that formula.
trellis.currentLayoutReturns a matrix with as many rows and columns as inthe layout of panels in the current plot.
trellis.deviceInitialization of a display device with appropriategraphical parameters.
trellis.focus, trellis.grobnametrellis.focus can beused to move to a particular panel or strip, identified by itsposition in the array of panels.
trellis.last.objectUpdates method for objects of class "trellis" and is a way to retrievethe last printed trellisobject (that was saved).
trellis.panelArgsOnce a panel or strip is in focus (e.g., by usingtrellis.switchFocus), trellis.panelArgs can beused to retrieve the arguments that were available to thepanel function at thatposition.
trellis.par.get, trellis.par.setFunctions used to query, display, and modify graphicalparameters for fine control of Trellis displays. Modificationsare made to the settings for the currently active deviceonly.
trellis.switchFocusA convenience function to switch from one viewport toanother, while preserving the current row and column.
trellis.unfocusUnsets the focus and makes the top-level viewport thecurrent viewport.
trellis.vpnameReturns the name of a viewport.
which.packetReturns the combination of levels of the conditioningvariables in the form of a numeric vector as long as thenumber of conditioning variables, with each element an integerindexing the levels of the corresponding variable.
wireframeGeneric function to draw 3D scatter plots and surfaces.The "formula" methods domost of the actual work.
xscale.components.default, yscale.components.defaultReturn a list of the form suitable as the componentsargument of axis.default.
xyplotProduces conditional scatter plots.

Data Sets

Data SetClassDescription
barleydata.frameTotal yield in bushels per acre for 10 varieties at 6sites in each of 2 years.
environmentaldata.frameDaily measurements of ozone concentration, wind speed, temperature, and solar radiation in New York City from May toSeptember of 1973.
ethanoldata.frameEthanol fuel was burned in a single-cylinder engine.For various settings of the engine compression and equivalenceratio, the emissions of nitrogen oxides were recorded.
melanomadata.frameThis data from the Connecticut Tumor Registry presentsage-adjusted numbers of melanoma skin cancer incidences per100, 000 people in Connecticut for the years 1936–1972.
singerdata.frameHeights, in inches, of the singers in the New YorkChoral Society in 1979. The data is grouped according to voicepart. The vocal range for each voice part increases in pitchaccording to the following order: Bass 2, Bass 1, Tenor 2, Tenor 1, Alto 2, Alto 1, Soprano 2, Soprano 1.

MASS

This is the main package of Venables and Ripley'sMASS.

Functions

FunctionDescription
NullGiven a matrix M, finds a matrix N giving abasis for the null space. That is, t(N) \%*\% M is the 0, and N has the maximum number of linearlyindependent columns.
ShepardOne form of nonmetric multidimensional scaling.
addtermTries fitting all models that differ from the currentmodel by adding a single term from those supplied, maintainingmarginality.
areaIntegrates a function of one variable over a finiterange using a recursive adaptive method. This function ismainly for demonstration purposes.
as.fractionsFinds rational approximations to the components of areal numeric object using a standard continued fractionmethod.
bandwidth.nrdA well-supported rule of thumb for choosing thebandwidth of a Gaussian kernel density estimator.
bcvUses biased cross-validation to select the bandwidth ofa Gaussian kernel density estimator.
boxcoxComputes and optionally plots profile log-likelihoodsfor the parameter of the Box-Cox power transformation.
con2trConverts lists to data frames for use bylattice.
contr.sdifA coding for unordered factors based on successivedifferences.
correspFinds the principal canonical correlation andcorresponding row and column scores from a correspondenceanalysis of a two-way contingency table.
cov.mcd, cov.mve, cov.robCompute a multivariate location and scale estimate witha high breakdown point. This can be thought of as estimatingthe mean and covariance of the good part of the data. cov.mve and cov.mcd are compatibilitywrappers.
cov.trobEstimates a covariance or correlation matrix assumingthe data came from a multivariatet-distribution: this provides some degreeof robustness to outliers without giving a high breakdownpoint.
denumerateloglm allowsdimension numbers to be used in place of names in the formula.denumerate modifies such aformula into one that termscan process.
dose.pCalibrates binomial assays, generalizing thecalculation of LD50.
droptermTries fitting all models that differ from the currentmodel by dropping a single term, maintainingmarginality.
eqscplotVersion of a scatter plot with scales chosen to beequal on both axes, i.e., 1 cm represents the same units oneach.
fitdistrMaximum likelihood fitting of univariate distributions, allowing parameters to be held fixed, if desired.
fractionsFinds rational approximations to the components of areal numeric object using a standard continued fractionmethod.
gamma.dispersionA frontend to gamma.shape for convenience. Findsthe reciprocal of the estimate of the shape parameteronly.
gamma.shapeFinds the maximum likelihood estimate of the shapeparameter of the gamma distribution after fitting a Gamma generalized linearmodel.
ginvCalculates the Moore-Penrose generalized inverse of amatrix X.
glm.convertModifies an output object from glm.nb() to one that looks like theoutput from glm() with anegative binomial family. This allows it to be updated keepingthe theta parameter fixed.
glm.nbA modification of the system function glm() to include estimation of theadditional parameter, theta, for a negative binomialgeneralized linear model.
glmmPQLFits a generalized linear mixed model (GLMM) withmultivariate normal random effects, using penalizedquasi-likelihood.
hist.FDPlots a histogram with automatic bin width selection, using the Scott or Freedman-Diaconis formula.
hist.scottPlots a histogram with automatic bin width selection, using the Scott or Freedman-Diaconis formula.
huberFinds the Huber M-estimator of location with the medianabsolute deviation (MAD) scale.
hubersFinds the Huber M-estimator for location with scalespecified, scale with location specified, or both if neitheris specified.
is.fractionsFinds rational approximations to the components of areal numeric object using a standard continued fractionmethod.
isoMDSOne form of nonmetric multidimensional scaling.
kde2dTwo-dimensional kernel density estimation with anaxis-aligned bivariate normal kernel, evaluated on a squaregrid.
ldaLinear discriminant analysis.
ldahistPlots histograms or density plots of data on a singleFisher linear discriminant.
lm.glsFits linear models by generalized leastsquares.
lm.ridgeFits a linear model by ridge regression.
lmsregFits a regression to the goodpoints in the data set, thereby achieving a regressionestimator with a high breakdown point. (lmsreg is a compatibility wrapperfor lqs.)
lmworkThe standardized residuals. These are normalized tounit variance, fitted including the current datapoint.
loglmProvides a frontend to the standard function, loglin, to allow log-linear modelsto be specified and fitted in a manner similar to that ofother fitting functions, such as glm.
logtransFinds and optionally plots the marginal (profile)likelihood for alpha for a transformation model of the formlog(y + alpha) ~ x1 + x2 +....
lqs, lqs.formulaFit a regression to the goodpoints in the data set, thereby achieving a regressionestimator with a high breakdown point. lmsreg and ltsreg are compatibilitywrappers.
ltsregA compatibility wrapper for lqs.
mcaComputes a multiple-correspondence analysis of a set offactors.
mvrnormProduces one or more samples from the specifiedmultivariate normal distribution.
negative.binomialSpecifies the information required to fit a negativebinomial generalized linear model, with known theta parameter, using glm().
parcoordParallel coordinates plot.
polrFits a logistic or probit regression model to anordered factor response. The default logistic case isproportional odds logistic regression, after which the function is named.
psi.bisquare, psi.hampel, psi.huberPsi functions for rlm.
qdaFits quadratic discriminant analysis models.
rationalFinds rational approximations to the components of areal numeric object using a standard continued fractionmethod.
renumeratedenumerate convertsa formula written using the conventions of loglm into one that terms is able to process. renumerate converts it back again toa form like the original.
rlmFits a linear model by robust regression using anM-estimator.
rms.curvCalculates the root mean square parameter effects andintrinsic relative curvatures, cθ andcι, for afitted nonlinear regression.
rnegbinGenerates random outcomes from a negative binomialdistribution, with mean muand variance mu + mu^2/theta.
sammonOne form of nonmetric multidimensional scaling.
selectFits a linear model by ridge regression.
stdresThe standardized residuals. These are normalized tounit variance, fitted including the current datapoint.
stepAICPerforms stepwise model selection by AIC.
studresExtracts the Studentized residuals from a linearmodel.
theta.md, theta.ml, theta.mmGiven the estimated mean vector, estimate theta of the negative binomialdistribution.
truehistCreates a histogram on the current graphicsdevice.
ucvUses unbiased cross-validation to select the bandwidthof a Gaussian kernel density estimator.
width.SJUses the method of Sheather and Jones to select thebandwidth of a Gaussian kernel density estimator.
write.matrixWrites a matrix or data frame to a file or the console, using column labels and a layout respecting columns.

Data Sets

Data SetClassDescription
Aids2data.frameData on patients diagnosed with AIDS inAustralia before July 1, 1991.
Animalsdata.frameAverage brain and body weights for 28 species of landanimals.
Bostondata.frameThe Boston dataframe has 506 rows and 14 columns.
Cars93data.frameThe Cars93 dataframe has 93 rows and 27 columns.
Cushingsdata.frameCushing's syndrome is a hypertensive disorderassociated with oversecretion of cortisol by the adrenalgland. The observations are urinary excretion rates of twosteroid metabolites.
DDTnumericA numeric vector of 15 measurements by differentlaboratories of the pesticide DDT in kale, in ppm (parts permillion), using the multiple pesticide residuemeasurement.
GAGurinedata.frameData was collected on the concentration of the chemicalglycosaminoglycan (GAG) in the urine of 314 children aged 0 to17 years. The aim of the study was to produce a chart to helpa pediatrican to assess if a child's GAG concentration is"normal."
Insurancedata.frameThe data given in data frame Insurance consists of the numbers ofpolicyholders of an insurance company who were exposed torisk, and the numbers of car insurance claims made by thosepolicyholders in the third quarter of 1973.
Melanomadata.frameThe Melanoma dataframe has data on 205 patients in Denmark with malignantmelanoma.
OMEdata.frameExperiments were performed on children on their abilityto differentiate a signal in broadband noise. The noise wasplayed from a pair of speakers, and a signal was added to justone channel; the subject had to turn his/her head to thechannel with the added signal. The signal was either coherent(the amplitude of the noise was increased for a period) orincoherent (independent noise was added for the same period toform the same increase in power). The threshold used in theoriginal analysis was the stimulus loudness needed to get 75%correct responses. Some of the children had suffered fromotitis media with effusion (OME).
Pima.tedata.frameA population of women who were at least 21 years old, of Pima Indian heritage, and living near Phoenix, Arizona, wastested for diabetes according to World Health Organizationcriteria. The data was collected by the National Institute ofDiabetes and Digestive and Kidney Diseases. A total of 532complete records was used, after dropping the (mainly missing)data on serum insulin.
Pima.trdata.frameA population of women who were at least 21 years old, of Pima Indian heritage, and living near Phoenix, Arizona, wastested for diabetes according to World Health Organizationcriteria. The data was collected by the National Institute ofDiabetes and Digestive and Kidney Diseases. A total of 532complete records was used, after dropping the (mainly missing)data on serum insulin.
Pima.tr2data.frameA population of women who were at least 21 years old, of Pima Indian heritage, and living near Phoenix, Arizona, wastested for diabetes according to World Health Organizationcriteria. The data was collected by the National Institute ofDiabetes and Digestive and Kidney Diseases. A total of 532complete records was used, after dropping the (mainly missing)data on serum insulin.
Rabbitdata.frameFive rabbits were studied on two occasions, aftertreatment with saline (control) and after treatment with the5-HT_3 antagonist MDL 72222. After each treatment, ascendingdoses of phenylbiguanide were injected intravenously at10-minute intervals and the responses of mean blood pressuremeasured. The goal was to test whether the cardiogenic chemoreflex elicited byphenylbiguanide depends on the activation of 5-HT_3receptors.
Rubberdata.frameData frame from accelerated testing of tirerubber.
SP500numericReturns of the Standard & Poors 500 Index in the1990s.
Sitkadata.frameThe Sitka data framehas 395 rows and 4 columns. It gives repeated measurements onthe log-size of 79 Sitka spruce trees, 54 of which were grownin ozone-enriched chambers and 25 were controls. The size wasmeasured five times in 1988, at roughly monthly intervals.
Sitka89data.frameThe Sitka89 dataframe has 632 rows and 4 columns. It gives repeatedmeasurements on the log-size of 79 Sitka spruce trees, 54 ofwhich were grown in ozone-enriched chambers and 25 werecontrols. The size was measured eight times in 1989, atroughly monthly intervals.
Skyedata.frameThe Skye data framehas 23 rows and 3 columns.
Trafficdata.frameAn experiment was performed in Sweden in 1961–1962 toassess the effect of a speed limit on the highway accidentrate. The experiment was conducted on 92 days in each year, matched so that day j in1962 was comparable to day j in 1961. On some days, the speedlimit was in effect and enforced, while on other days therewas no speed limit and cars tended to be driven faster. Thespeed limit days tended to be in contiguous blocks.
UScerealdata.frameThe UScereal dataframe has 65 rows and 11 columns. The data comes from the 1993American Statistical Association (ASA) Statistical GraphicsExposition and is taken from the mandatory Food and DrugAdministration (FDA) food label. The data has been normalizedhere to a portion of one American cup.
UScrimedata.frameCriminologists are interested in the effect ofpunishment regimes on crime rates. This has been studied usingthe aggregate data on 47 states of the United States for 1960given in this data frame. The variables seem to have beenrescaled to convenient numbers.
VAdata.frameVeteran's Administration lung cancer trial fromKalbfleisch and Prentice.
abbeynumericA numeric vector of 31 determinations of nickel content(ppm) in a Canadian syenite rock.
accdeathstsA regular time series giving the monthly totals ofaccidental deaths in the United States.
anorexiadata.frameThe anorexia dataframe has 72 rows and 3 columns. Weight change data for youngfemale anorexia patients.
bacteriadata.frameTests of the presence of the bacteria H.influenzae in children with otitis media in theNorthern Territory of Australia.
beav1data.frameReynolds describes a small part of a study of thelong-term temperature dynamics of the beaver (Castorcanadensis) in north-central Wisconsin. Bodytemperature was measured by telemetry every 10 minutes forfour females, but data from a one period of less than a dayfor each of two animals is used here.
beav2data.frameReynolds describes a small part of a study of thelong-term temperature dynamics of the beaver (Castorcanadensis) in north-central Wisconsin. Bodytemperature was measured by telemetry every 10 minutes forfour females, but data from a period of less than a day foreach of two animals is used here.
biopsydata.frameThis breast cancer database was obtained from theUniversity of Wisconsin Hospitals, Madison, from Dr. WilliamH. Wolberg. He assessed biopsies of breast tumors for 699patients up to July 15, 1992; each of nine attributes has beenscored on a scale of 1 to 10, and the outcome is also known.There are 699 rows and 11 columns.
birthwtdata.frameThe birthwt dataframe has 189 rows and 10 columns. The data was collected atBaystate Medical Center, Springfield, Massachusetts, during1986.
cabbagesdata.frameThe cabbages dataset has 60 observations and 4 variables.
caithdata.frameData on the cross-classification of people inCaithness, Scotland, by eye and hair color. This region of theUnited Kingdom is particularly interesting as there is amixture of people of Nordic, Celtic, and Anglo-Saxonorigin.
catsdata.frameThe heart and body weights of samples of male andfemale cats used for digitalis experiments. The cats were alladult, over 2 kg in body weight.
cementdata.frameExperiment on the heat evolved in the setting of eachof 13 cements.
chemnumericA numeric vector of 24 determinations of copper inwholemeal flour, in parts per million.
coopdata.frameSeven specimens were sent to six laboratories in threeseparate batches and each analyzed for analyte. Each analysiswas duplicated.
cpusdata.frameA relative performance measure and characteristics of209 CPUs.
crabsdata.frameThe crabs data framehas 200 rows and 8 columns, describing 5 morphologicalmeasurements on 50crabs, each of two color forms and both sexes, of the speciesLeptograpsusvariegatus, collected at Fremantle, Western Australia.
deathstsA time series giving the monthly deaths frombronchitis, emphysema, and asthma in the United Kingdom, 1974–1979, for both sexes.
driverstsA regular time series giving the monthly totals of cardrivers in Great Britain killed or seriously injured fromJanuary 1969 to December 1984. Compulsory wearing of seatbelts was introduced on January 31, 1983.
eaglesdata.frameKnight and Skagen collected data during a field studyon the foraging behavior of wintering bald eagles inWashington State. The data concerned 160 attempts by one(pirating) bald eagle to steal a chum salmon from another(feeding) bald eagle.
epildata.frameThall and Vail give a data set on 2-week seizure countsfor 59 epileptics. The number of seizures was recorded for abaseline period of 8 weeks, and then patients were randomlyassigned to a treatment group or a control group. Counts werethen recorded for four successive 2-week periods. Thesubject's age is the only covariate.
farmsdata.frameThe farms data framehas 20 rows and 4 columns. The rows are farms on the Dutchisland of Terschelling, and the columns are factors describingthe management of grassland.
fgldata.frameThe fgl data framehas 214 rows and 10 columns. It was collected by B. German onfragments of glass collected in forensic work.
forbesdata.frameA data frame with 17 observations on the boiling pointof water and barometric pressure, in inches ofmercury.
galaxiesnumericA numeric vector of velocities, in kilometers/second, of 82 galaxies from 6 well-separated conic sections of anunfilled survey of theCorona Borealis region. Multimodality in such surveys isevidence for voids and superclusters in the faruniverse.
gehandata.frameA data frame from a trial of 42 leukemia patients. Somewere treated with the drug 6-mercaptopurine, and the rest werecontrols. The trial was designed as matched pairs, bothwithdrawn from the trial when either came out ofremission.
genotypedata.frameData from a foster feeding experiment with rat mothersand litters of four different genotypes: A, B, I and J. Rat litters were separated fromtheir natural mothers at birth and given to foster mothers torear.
geyserdata.frameA version of the eruptions data from the Old Faithfulgeyser in Yellowstone National Park, Wyoming. This versioncomes from Azzalini and Bowman and is of continuousmeasurement from August 1 to August 15, 1985. Some nocturnalduration measurements were coded as 2, 3, or 4 minutes, havingoriginally been described as "short, " "medium, " or"long."
gilgaisdata.frameThis data set was collected on a line transect surveyin gilgai territory in New South Wales, Australia. Gilgais arenatural gentle depressions in otherwise flat land, andsometimes they seem to be regularly distributed. The datacollection was stimulated by the question: are these patternsreflected in soil properties? At each of 365 samplinglocations on a linear grid of 4 meters, spacing, samples weretaken at depths 0–10 cm, 30–40 cm, and 80–90 cm below thesurface. pH, electrical conductivity, and chloride contentwere measured on a 1:5 soil:water extract from eachsample.
hillsdata.frameThe record times in 1984 for 35 Scottish hillraces.
housingdata.frameThe housing dataframe has 72 rows and 5 variables.
immerdata.frameThe immer data framehas 30 rows and 4 columns. Five varieties of barley were grownin six locations in 1931 and in 1932.
leukdata.frameA data frame of data from 33 leukemia patients.
mammalsdata.frameA data frame with average brain and body weights for 62species of land mammals.
mcycledata.frameA data frame giving a series of measurements of headacceleration in a simulated motorcycle accident; used to testcrash helmets.
menarchedata.frameProportions of female children at various ages duringadolescence who have reached menarche.
michelsondata.frameMeasurements of the speed of light in air, made betweenJune 5, and July 2, 1879. The data consists of 5 experiments, each consisting of 20 consecutive runs. The response is thespeed of light, in kilometers/second, less 299, 000. Thecurrently accepted value, on this scale of measurement, is734.5.
minn38data.frameMinnesota high school graduates of 1938 were classifiedaccording to four factors. The minn38 data frame has 168 rows and 5columns.
motorsdata.frameThe motors dataframe has 40 rows and 3 columns. It describes an acceleratedlife test at each of four temperatures of 10 motorettes andhas rather discrete times.
muscledata.frameThe purpose of this experiment was to assess theinfluence of calcium in solution on the contraction of heartmuscle in rats. The left auricle of 21 rat hearts wasisolated, and on several occasions a constant-length strip oftissue was electrically stimulated and dipped into variousconcentrations of calcium chloride solution, after which theshortening of the strip was accurately measured as theresponse.
newcombnumericA numeric vector giving the "Third Series" ofmeasurements of the passage time of light recorded by Newcombin 1882. The given values divided by 1, 000 plus 24 give thetime, in millionths of a second, for light to traverse a knowndistance. The "true" value is now considered to be33.02.
nlschoolsdata.frameSnijders and Bosker use as a running example a study of2, 287 eighth-grade pupils (aged about 11) in 132 classes in131 schools in the Netherlands. Only the variables used intheir examples are supplied.
npkdata.frameA classical N, P, K (nitrogen, phosphate, potassium)factorial experiment on the growth of peas conducted on sixblocks. Each half of a fractional factorial design confoundingthe NPK interaction was used on three of the plots.
npr1data.frameData on the locations, porosity, and permeability (ameasure of oil flow) on 104 oil wells in the U.S. NavalPetroleum Reserve No. 1 in California.
oatsdata.frameThe yield of oats from a split-plot field trial usingthree varieties and four levels of manurial treatment. Theexperiment was laid out in six blocks of three main plots, each split into four subplots. The varieties were applied tothe main plots and the manurial treatments to thesubplots.
paintersdata.frameThe subjective assessment, on an integer scale of 0 to20, of 54 classical painters. The painters were assessed onfour characteristics: composition, drawing, color, andexpression. The data is due to the 18th-century art critic, dePiles.
petroldata.frameThe yield of a petroleum refining process with fourcovariates. The crude oil appears to come from only 10distinct samples. This data was originally used by Prater tobuild an estimation equation for the yield of the refiningprocess of crude oil to gasoline.
phoneslistA list object with the annual number of telephone callsin Belgium.
quinedata.frameThe quine data framehas 146 rows and 5 columns. Children from Walgett, New SouthWales, Australia, were classified by culture, age, sex, andlearner status, and the number of days absent from school in aparticular school year was recorded.
roaddata.frameA data frame with the annual deaths in road accidentsfor half the U.S. states.
rotiferdata.frameThe data give the numbers of rotifers falling out ofsuspension for different fluid densities.
shipsdata.frameData frame giving the number of damage incidents andaggregate months of service by ship type, year ofconstruction, and period of operation.
shoeslistA list of two vectors, giving the wear of shoes ofmaterials A and B for one foot each of 10 boys.
shrimpnumericA numeric vector with 18 determinations by differentlaboratories of the amount (percentage of the declared totalweight) of shrimp in shrimp cocktail.
shuttledata.frameThe shuttle dataframe has 256 rows and 7 columns. The first six columns arecategorical variables giving example conditions; the seventhis the decision. The first 253 rows are the training set, thelast 3 the test conditions.
snailsdata.frameGroups of 20 snails were held for periods of 1, 2, 3, or 4 weeks under carefully controlled conditions oftemperature and relative humidity. There were two species ofsnail, A and B, and the experiment was designed as a4-by-3-by-4-by-2 completely randomized design. At the end ofthe exposure time, the snails were tested to see if they hadsurvived; the process itself is fatal for the animals. Theobject of the exercise was to model the probability ofsurvival in terms of the stimulus variables and, inparticular, to test for differences between species. The data areunusual in that, in most cases, fatalities during theexperiment were fairly small.
steamdata.frameTemperature and pressure in a saturated steam-drivenexperimental device.
stormerdata.frameThe stormer viscometer measures the viscosity of afluid by measuring the time taken for an inner cylinder in themechanism to perform a fixed number of revolutions in responseto an actuating weight. The viscometer is calibrated bymeasuring the time taken with varying weights while themechanism is suspended in fluids of accurately knownviscosity. The data comes from such a calibration, andtheoretical considerations suggest a nonlinear relationshipamong time, weight, and viscosity of the form Time = (B1 * Viscosity)/(Weight - B2) +E, where B1 andB2 are unknown parametersto be estimated, and E iserror.
surveydata.frameThis data frame contains the responses of 237Statistics I students at the University of Adelaide to anumber of questions.
synth.tedata.frameThe synth.tr dataframe has 250 rows and 3 columns. The synth.te data frame has 100 rows and3 columns. It is intended that synth.tr be used from training andsynth.te fortesting.
synth.trdata.frameThe synth.tr dataframe has 250 rows and 3 columns. The synth.te data frame has 100 rows and3 columns. It is intended that synth.tr be used from training andsynth.te fortesting.
topodata.frameThe topo data framehas 52 rows and 3 columns, of topographic heights within a310-foot square.
wadersdata.frameThe waders dataframe has 15 rows and 19 columns. The entries are counts ofwaders in summer.
whitesidedata.frameMr. Derek Whiteside of the UK Building Research Stationrecorded the weekly gas consumption and average externaltemperature at his own house in southeast England for twoheating seasons, one of 26 weeks before, and one of 30 weeksafter cavity-wall insulation was installed. The object of theexercise was to assess the effect of the insulation on gasconsumption.
wtlossdata.frameThis data frame gives the weight, in kilograms, of anobese patient at 52 time points over an 8-month period of aweight rehabilitation program.

methods

This package contains formally defined methods and classesfor R objects, plus other programming tools.

Functions

FunctionDescription
@<-Gets or sets information about the individual slots inan object.
MethodAddCoercePossibly modifies one or more methods to explicitlycoerce this argument to methodClass, the class forwhich the method is explicitly defined.
QuoteThese are utilities, currently in the methods package, that either providesome functionality needed by the package (e.g., elementmatching by name) or add compatibility with S-PLUS, orboth.
S3Class, S3Class<-S3Class extracts orreplaces the S3-style class from an S4 class that was createdfrom an S3 class through setOldClass.
S3Part, S3Part<-The function S3Partextracts or replaces the S3 part of such an object.
addNextMethodGeneric function that finds the next method for thesignature of the method definition method and caches thatmethod in the method definition.
allNamesReturns the character vector of names (unlike names(), never returns NULL) for amethod.
as, as<-Manage the relations that allow coercing an object to agiven class.
asMethodDefinitionTurns a function definition into an object of classMethodDefinition, corresponding to the given signature (by default, generates adefault method with empty signature).
assignClassDefAssigns the definition of the class to the speciallynamed object.
assignMethodsMetaDataUtility to assign the metadata object recording themethods defined in a particular package.
balanceMethodsListCalled from setMethod to ensure that all nodes in thelist have the same depth (i.e., the same number of levels ofarguments).
body<-Sets the body of a method.
cacheGenericsMetaData, cacheMetaDataUtilities for ensuring that the internal informationabout class and method definitions is up to date. Shouldnormally be called automatically whenever needed (e.g., when amethod or class definition changes or when a package isattached or detached).
cacheMethodStores the definition for this function and signaturein the method metadata for the function.
callGenericThe name and package of the current generic function isstored in the environment of the method definitionobject.
callNextMethodA call to callNextMethod can only appearinside a method definition. It then results in a call to thefirst inherited method after the current method, with thearguments to the current method passed down to the nextmethod. The value of that method call is the value of callNextMethod.
canCoerceTests if an object can be coerced to a given S4class.
cbind2Combines two matrix-like R objects by columns (cbind2) or rows (rbind2). These are (S4) genericfunctions with default methods.
checkSlotAssignmentChecks that the value provided is allowed for thisslot, by consulting the definition of the class. Called fromthe C code that assigns slots.
classMetaNameA name for the object storing this class'sdefinition.
classesToAMGiven a vector of class names or a list of classdefinitions, returns an adjacency matrix of the superclassesof these classes; i.e., a matrix with class names as the rowand column names and with element [i, j] being 1 if the classin column j is a direct superclass of the class in row i, and0 otherwise.
coerce, coerce<-Manage the relations that allow coercing an object to agiven class.
completeClassDefinitionCompletes the definition of Class, relative to theclass definitions visible from environment where. If doExtendsis TRUE, completes the super- and subclass information.
completeExtendsCompletes the extends information in the classdefinition, by following transitive chains.
completeSubclasses 
conformMethodIf the formal arguments, mnames, are not identical tothe formal arguments to the function, fnames, conformMethoddetermines whether the signature and the two sets of argumentsconform and returns the signature, possibly extended.
defaultDumpNameDefault name to be used for dumping a method.
defaultPrototypeThe prototype for a class that will have slots, is nota virtual class, and does not extend one of the basic classes.Both its class and its (R internal) type, typeof(), are "S4."
doPrimitiveMethodPerforms a primitive call to built-in function name thedefinition and call provided, and carried out in the specifiedenvironment.
dumpMethodDumps the method for this generic function andsignature.
dumpMethodsDumps all the methods for this generic.
elNamed, elNamed<-Get or set the element of the vector corresponding toname.
existsFunctionIs there a function of this name? If generic is FALSE, generic functions are not counted.
existsMethodTests for the existence of a method corresponding to agiven generic function and signature.
extendsFunction to test inheritance relationships between anobject and a class (is) orbetween two classes (extends) and to establish suchrelationships (setIs, anexplicit alternative to the contains= argument to setClass).
findClassFunction to find and manipulate classdefinitions.
findFunctionReturns a list of either the positions on the searchlist or the current top-level environment on which a functionobject for name exists.
findMethodReturns the package(s) in the search list (or in thepackages specified by the where argument) that contain amethod for this function and signature.
findMethodSignaturesReturns a character matrix whose rows are the classnames from the signature of the corresponding methods; itoperates either from a list returned by findMethods or by computing such alist itself, given the same arguments as findMethods.
findMethodsReturns a list of the method definitions currentlyexisting for generic function f, limited to the methods defined inenvironment where if thatargument is supplied and possibly limited to those includingone or more of the specified classes in the methodsignature.
findUniqueReturns the list of environments (or equivalent) havingan object named what, using environment where and its parentenvironments.
fixPre1.8Beginning with R version 1.8.0, the class of an objectcontains the identification of the package in which the classis defined. The function fixPre1.8 fixes and reassignsobjects missing that information (typically because they wereloaded from a file saved with a previous version ofR).
formalArgsReturns the names of the formal arguments of thisfunction.
functionBody, functionBody<-These are utilities, currently in the methods package, that either provide some functionality needed by the package(e.g., element matching by name) or add compatibility withS-PLUS, or both.
generic.skeletonUtility functions to support the definition and use offormal methods. Most of these functions will not normally becalled directly by the user.
getAllSuperClassesGets the names of all the classes that this classdefinition extends.
getClass, getClassDefGet the definition of a class.
getClassesFunction to find and manipulate classdefinitions.
getDataPartUtility called to implement object@.Data.
getFromClassDefExtracts one of the intrinsically defined classdefinition properties (".Properties", etc.). Strictly autility function.
getFunctionThese are utilities, currently in the methods package, that either provide some functionality needed by the package(e.g., element matching by name) or add compatibility withS-PLUS, or both.
getGenericReturns the definition of the function named f as a generic.
getGenericsReturns the names of the generic functions that havemethods defined on where; this argument can be an environmentor an index into the search list.
getGroupReturns the groups to which this generic belongs, searching from environment where (the global environmentnormally by default).
getGroupMembersReturns all the members of the group generic functionnamed group.
getMethodReturns the method corresponding to a given genericfunction and signature.
getMethodsAn older alternative to findMethods, returning informationin the form of an object of class MethodsList, previously used formethod dispatch.
getMethodsForDispatchSupport routine for computations on formalmethods.
getMethodsMetaDataUtility to get the metadata object recording themethods defined in a particular package.
getPackageNameReturns the package associated with a particularenvironment or position on the search list, or the packagecontaining a particular function.
getSlotsReturns a named character vector. The names are thenames of the slots; the values are the classes of thecorresponding slots.
getValidityThe validity of object related to its classdefinition is tested. If the object is valid, TRUE is returned; otherwise, eithera vector of strings describing validity failures is returnedor an error is generated (according to whether test is TRUE).
hasArgReturns TRUE ifname corresponds to anargument in the call, either a formal argument to the functionor a component of ..., andFALSE otherwise.
hasMethodTests for the existence of a method corresponding to agiven generic function and signature.
hasMethodsReturns TRUE orFALSE according to whetherthere is a nonempty table of methods for function f in the environment or searchposition where (or anywhereon the search list if whereis missing).
implicitGenericReturns the implicit generic version.
initializeGiven the name or the definition of a class, plusoptionally data to be included in the object, initializereturns an object from that class.
isFunction to test inheritance relationships between anobject and a class (is) orbetween two classes (extends) and to establish suchrelationships (setIs, anexplicit alternative to the contains= argument to setClass).
isClassFunction to find and manipulate classdefinitions.
isClassDefIs object a representation of a class?
isClassUnionTests if a class is a "ClassUnion".
isGenericIs there a function named f, and, if so, is it ageneric?
isGroupManages collections of methods associated with ageneric function, as well as providing information about thegeneric functions themselves.
isSealedClass, isSealedMethodCheck for either a method or a class that has beensealed when it was defined and thereforecannot be redefined.
isVirtualClassIs the named class a virtual class?
isXS3ClassOld-style (S3) classes may be registered as S4 classes(by calling setOldClass), and many have been. These classes can then be contained in(i.e., superclasses of) regular S4 classes, allowing formalmethods and slots to be added to the S3 behavior. The functionS3Part extracts or replacesthe S3 part of such an object. S3Class extracts or replaces theS3-style class. S3Classalso applies to objects from an S4 class with S3methods=TRUE in the call tosetClass.
listFromMethodsSupport routine for computations on formalmethods.
makeClassRepresentationConstructs an object of class classRepresentation to describe aparticular class. Mostly a utility function, but you can callit to create a class definition without assigning it, assetClass would do.
makeExtendsConverts the argument to a list defining the extensionmechanism.
makeGenericMakes a generic function object corresponding to thegiven function name, optional definition, and optional defaultmethod.
makePrototypeFromClassDefMakes the prototype implied by the classdefinition.
makeStandardGenericA utility function that makes a valid function callingstandardGeneric for namef.
matchSignatureMatches the signature object (a partially or completelynamed subset of the signature arguments of the genericfunction object fun) and returns a vector of all the classesin the order specified by fun@signature.
metaNameUndoAs its name implies, this function undoes the namemangling used to produce metadata object names and returns anobject of class ObjectsWithPackage.
method.skeletonWrites a source file containing a call to setMethod to define a method for thegeneric function and signature supplied. By default, themethod definition is in line in the call, but can be made anexternal (previously assigned) function.
methodSignatureMatrixReturns a matrix with the contents of the specifiedslots as rows.
methodsPackageMetaNameA name-mangling device to hide metadata defining methodand class information.
missingArgReturns TRUE if thesymbol supplied is missing from the call corresponding to theenvironment supplied (by default, environment of the call tomissingArg).
newGiven the name or the definition of a class, plusoptionally data to be included in the object, new returns an object from thatclass.
newBasicThe implementation of the function new for basic classes that don'thave a formal definition.
newClassRepresentationVarious functions to support the definition and use offormal classes. Most of them are rarely suitable to be calleddirectly. Others are somewhat experimental and/or partiallyimplemented only. Do refer to setClass for normal codedevelopment.
newEmptyObjectUtility function to create an empty object into whichslots can be set.
packageNameReturns the character-string name of the package(without the extraneous "package:" found in the searchlist).
packageSlot, packageSlot<-Return or set the package name slot (currently anattribute, not a formal slot, but this may changesomeday).
possibleExtendsFinds the information that says whether one classextends another, directly or indirectly.
prohibitGenericPrevents your function from being made generic.
promptClassCreates a help file for a class definition containingall relevant slot and method information for a class, withminimal markup for Rd processing; no QC facilities atpresent.
promptMethodsGenerates a shell of documentation for the methods of ageneric function.
prototypeIn calls to setClass, this function constructsthe prototypeargument.
rbind2Combines two matrix-like R objects by columns (cbind2) or rows (rbind2). These are (S4) genericfunctions with default methods.
reconcilePropertiesAndPrototypeMakes a list or a structure look like a prototype forthe given class.
registerImplicitGenericsSaves a set of implicit generic definitions in thecached table of the current session.
rematchDefinitionIf the specified method in a call to setMethodspecializes the argument list (by replacing ...), thenrematchDefinitionconstructs the actual method stored.
removeClassFunction to find and manipulate classdefinitions.
removeGenericRemoves all the methods for the generic function ofthis name and the function itself.
removeMethodCreates and saves a formal method for a given functionand list of classes.
removeMethodsRemoves all the methods for the generic function ofthis name.
representationIn calls to setClass, this function constructsthe representationargument.
requireMethodsRequires a subclass to implement methods for thegeneric functions, for this signature.
resetClassFunction to find and manipulate classdefinitions.
resetGenericSupport routine for computations on formalmethods.
sealClassFunction to find and manipulate classdefinitions.
selectMethodReturns a method corresponding to a given genericfunction and signature.
selectSuperClassesReturns superclasses of ClassDef, possibly only nonvirtualor direct or simple ones. This function is designed to be fastand, consequently, only works with the contains slot of the correspondingclass definitions.
sessionDataReturns the index of the session data in the searchlist, attaching it if it is not attached.
setAsManages the relations that allow coercing an object toa given class.
setClassCreates a class definition, specifying therepresentation (the slots) and/or the classes contained inthis one (the superclasses), plus other optionaldetails.
setClassUnionA class may be defined as theunion of other classes, i.e., as avirtual class defined as a superclass of several otherclasses.This function creates class unions.
setDataPartUtility called to implement object@.Data. Calls to setDataPart are also used to mergethe data part of a superclass prototype.
setGenericCreates a new generic function of the given name, i.e., a function that dispatches methods according to the classes ofthe arguments, from among the formal methods defined for thisfunction.
setGenericImplicitTurns a generic implicit.
setGroupGenericCreates a new generic function of the given name, i.e., a function that dispatches methods according to the classes ofthe arguments, from among the formal methods defined for thisfunction.
setIsFunction to test inheritance relationships between anobject and a class (is) orbetween two classes (extends) and to establish suchrelationships (setIs, anexplicit alternative to the contains= argument to setClass).
setMethodCreates and saves a formal method for a given functionand list of classes.
setOldClassRegisters an old-style ("S3") class as a formallydefined class. The Classesargument is the character vector used as the class attribute; in particular, ifthere is more than one string, old-style class inheritance ismimicked. Registering via setOldClass allows S3 classes toappear in method signatures, as a slot in an S4 class or as asuperclass of an S4 class.
setPackageNameUsed to establish a package name in an environment thatwould otherwise not have one. This allows you to createclasses and/or methods in an arbitrary environment, but it isusually preferable tocreate packages by the standard R programming tools (package.skeleton, etc.).
setPrimitiveMethodsUtility functions to support the definition and use offormal methods. Most of these functions will not normally becalled directly by the user.
setReplaceMethodManages collections of methods associated with ageneric function, as well as providing information about thegeneric functions themselves.
setValiditySets the validity method of a class (but more normally, this method will be supplied as the validity argument to setClass).
showDisplays the object, by printing, plotting, or whateversuits its class. This function exists to be specialized bymethods. The default method calls showDefault. Formal methods forshow will usually beinvoked for automatic printing (see the details).
showClassPrints the information about a classdefinition.
showDefaultUtility used to enable show methods to be called by theautomatic printing (via print.default).
showExtendsPrints the elements of the list of extensions; forprintTo = FALSE, returns alist with components what and how; this is used, e.g., bypromptClass().
showMethodsShows a summary of the methods for one or more genericfunctions, possibly restricted to those involving specifiedclasses.
sigToEnvTurns the signature (a named vector of classes) into anenvironment with the classes assigned to the names.
signatureReturns a named list of classes to be matched toarguments of a generic function.
slot, slot<-Return or set information about the individual slots inan object.
slotNamesReturns or sets information about the individual slotsin an object.
slotsFromS3Old-style (S3) classes may be registered as S4 classes(by calling setOldClass), and many have been. These classes can then be contained in(i.e., superclasses of) regular S4 classes, allowing formalmethods and slots to be added to the S3 behavior. The functionS3Part extracts or replacesthe S3 part of such an object. S3Class extracts or replaces theS3-style class. S3Classalso applies to objects from an S4 class with S3methods=TRUE in the call tosetClass.
substituteDirectSubstitutes for the variables named in the secondargument the corresponding objects; substituting into object.
standardGenericDispatches a method from the current function call forthe generic function.
substituteFunctionArgsUtility function to support the definition and use offormal methods. Most of these functions will not normally becalled directly by the user.
superClassDepthsuperClassDepth, which is called from getAllSuperClasses, returns the sameinformation, but as a list with components label and depth, the latter for the number of generations back each class is inthe inheritance tree.
testInheritedMethodsA set of distinct inherited signatures is generated totest inheritance for all the methods of a specified genericfunction. If method selection is ambiguous for some of these, a summary of the ambiguities is attached to the returnedobject. This test should be performed by package authorsbefore releasing a package.
testVirtualTests for a virtual class.
traceOffThe functions traceOn and traceOff have been replaced byextended versions of the functions trace and untrace and should not beused.
traceOnThe functions traceOn and traceOff have been replaced byextended versions of the functions trace and untrace and should not beused.
tryNew, trySilentTries to generate a new element from this class, but ifthe attempt fails (as, e.g., when the class is undefined orvirtual) just returns NULL.
unRematchDefinitionUsing knowledge of how rematchDefinition works, unRematchDefinitionreverses the procedure; if given a function or methoddefinition that does not correspond to this form, it justreturns its argument.
validObjectThe validity of an object related to its classdefinition is tested. If the object is valid, TRUE is returned; otherwise, eithera vector of strings describing the validity failures isreturned or an error is generated (according to whethertest is TRUE).
validSlotNamesReturns names unless one of the names is reserved, inwhich case there is an error. (As of this writing, "class" isthe only reserved slot name.)

mgcv

This package provides functions for generalized additivemodeling and generalized additive mixed modeling. The term GAM is takento include any GLM estimated by quadratically penalized (possiblyquasi-) likelihood maximization. For more information on this package, see the help file.

nlme

This package provides functions for linear and nonlinearmixed-effects models. See the help file for more information.

nnet

This package provides functions for feed-forward neuralnetworks and multinomial log-linear models.

Functions

FunctionDescription
class.indGenerates a class indicator function from a givenfactor.
multinomFits multinomial log-linear models via neuralnetworks.
nnetFits single-hidden-layer neural network, possibly withskip-layer connections.
nnetHessEvaluates the Hessian (matrix of second derivatives) ofthe specified neural network. Normally called via argumentHess=TRUE to nnet or via vcov.multinom.
which.is.maxFinds the maximum position in a vector, breaking tiesat random.

rpart

This package provides functions for recursive partitioningand regression trees.

Functions

FunctionDescription
meanvarCreates a plot on the current graphics device of thedeviance of the node divided by the number of observations atthe node. Also returns the node number.
na.rpartHandles missing values in an rpart object.
path.rpartReturns a names list, where each element contains thesplits on the path from the root to the selected nodes.
plotcpGives a visual representation of the cross-validationresults in an rpartobject.
postGenerates a PostScript presentation plot of an rpart object.
printcpDisplays the cptable for a fitted rpartobject.
pruneDetermines a nested sequence of subtrees of thesupplied rpart object byrecursively snipping offthe least important splits, based on the complexity parameter(cp).
rpartFits an rpartmodel.
rpart.controlVarious parameters that control aspects of the rpart fit.
rpconvertRpart objects changed (slightly) in their internalformat in order to accommodate the changes for user-writtensplit functions. This routine updates an old object to the newformat.
rsq.rpartProduces two plots. The first plots ther-square (apparent and apparent − fromcross-validation) versus the number of splits. The secondplots the relative error(cross-validation) +/− 1 − SE fromcross-validation versus the number of splits.
snip.rpartCreates a "snipped" rpart object, containing the nodesthat remain after selected subtrees have been snipped off. Theuser can snip nodes using the toss argument or interactivelyby clicking the mouse button on specified nodes within thegraphics window.
xpred.rpartGives the predicted values for an rpart fit, under cross-validation, for a set of complexity parameter values.

Data Sets

Data SetClassDescription
car.test.framedata.frameThe car.test.frame data frame has 60rows and 8 columns, giving data on makes of cars taken fromthe April 1990 issue of Consumer Reports.This is part of a larger data set, some columns of which aregiven in cu.summary.
cu.summarydata.frameThe cu.summary dataframe has 117 rows and 5 columns, giving data on makes of carstaken from the April 1990 issue of ConsumerReports.
kyphosisdata.frameThe kyphosis dataframe has 81 rows and 4 columns, representing data on children who have had correctivespinal surgery.
solderdata.frameThe solder dataframe has 720 rows and 6 columns, representing a balancedsubset of a designed experiment varying 5 factors on thesoldering of components on printed-circuit boards.

spatial

This package provides functions for Kriging and pointpattern analysis.

Functions

FunctionDescription
KaverForms the average of a series of (usually simulated)K functions.
KenvlComputes envelope (upper and lower limits) and averageof simulations of K functions.
KfnActually computes L = sqrt(K/pi).
PsimSimulates binomial spatial point process.
SSISimulates SSI (sequential spatial inhibition) pointprocess.
StraussSimulates Strauss spatial point process.
anova.trlsComputes analysis of variance tables for one or morefitted trend surface model objects; where anova.trls is called with multipleobjects, it passes on the arguments to anovalist.trls.
anovalist.trlsComputes analysis of variance tables for one or morefitted trend surface model objects; where anova.trls is called with multipleobjects, it passes on the arguments to anovalist.trls.
correlogramComputes spatial correlograms of spatial data orresiduals.
expcovSpatial covariance function for use with surf.gls.
gaucovSpatial covariance function for use with surf.gls.
plot.trlsProvides the basic quantities used in forming a varietyof diagnostics for checking the quality of regression fits for trendsurfaces calculated by surf.ls.
ppgetregionRetrieves the rectangular domain (xl, xu) x (yl, yu) from the underlying Ccode.
ppinitReads a file in standard format and creates a pointprocess object.
pplikPseudolikelihood estimation of a Strauss spatial pointprocess.
ppregionSets the rectangular domain (xl, xu) x (yl, yu).
predict.trlsPredicted values based on trend surface modelobject.
prmatEvaluates Kriging surface over a grid.
sematEvaluates Kriging standard error of prediction over agrid.
sphercovSpatial covariance function for use with surf.gls.
surf.glsFits a trend surface by generalized leastsquares.
surf.lsFits a trend surface by least squares.
trls.influenceProvides the basic quantities used in forming a varietyof diagnostics for checking the quality of regression fits fortrend surfaces calculated by surf.ls.
trmatEvaluates trend surface over a grid.
variogramComputes spatial (semi-)variogram of spatial data orresiduals.

splines

This package provides functions for working withregression splines using the B-spline basis, bs, and the natural cubic spline basis, ns.

Functions

FunctionDescription
as.polySplineCreates the piecewise polynomial representation of aspline object.
asVectorThis is a generic function. Methods for this functioncoerce objects of given classes to vectors.
backSplineCreates a monotone inverse of a monotone naturalspline.
bsGenerates the B-spline basis matrix for a polynomialspline.
interpSplineCreates an interpolation spline, either from x and y vectors or from aformula/data.frame combination.
nsGenerates the B-spline basis matrix for a natural cubicspline.
periodicSplineCreates a periodic interpolation spline, either fromx and y vectors or from aformula/data.frame combination.
polySplineCreates the piecewise polynomial representation of aspline object.
spline.desEvaluates the design matrix for the B-splines definedby knots at the values inx.
splineDesignEvaluates the design matrix for the B-splines definedby knots at the values inx.
splineKnotsReturns the knot vector corresponding to a splineobject.
splineOrderReturns the order of a spline object.
xyVectorCreates an object to represent a set ofx-y pairs.

stats

This package contains functions to perform a wide varietyof statistical analyses.

Functions

FunctionDescription
AICGeneric function for calculating the Akaike informationcriterion for one or several fitted model objects for which alog-likelihood value can be obtained, according to the formula−2 ∗ log-likelihood + knpar, wherenpar representsthe number of parameters in the fitted model, and k= 2 for the usual AIC, or k =log(n) (n is thenumber of observations) for the so-called Bayesian informationcriterion (BIC) or Schwarz's Bayesian criterion (SBC).
ARMAacfComputes the theoretical autocorrelation function orpartial autocorrelation function for an autoregressive movingaverage (ARMA) process.
ARMAtoMAConverts an ARMA process to an infinite moving average(MA) process.
Box.testComputes the Box-Pierce or Ljung-Box test statistic forexamining the null hypothesis of independence in a given timeseries. These are sometimes known as "portmanteau"tests.
CSets the "contrasts"attribute for the factor.
DComputes derivatives of simple expressions, symbolically.
GammaFamily object for Gamma distributions (used byfunctions such as glm).
HoltWintersComputes Holt-Winters filtering of a given time series.Unknown parameters are determined by minimizing the squaredprediction error.
IQRComputes the interquartile range of the x values.
KalmanForecast, KalmanLike, KalmanRun, KalmanSmoothUse Kalman filtering to find the (Gaussian)log-likelihood, or for forecasting or smoothing.
NLSstAsymptoticFits the asymptotic regression model, in the formb0 + b1*(1-exp(-exp(lrc) *x), to the xydata. This can be used as a building block in determiningstarting estimates for more complicated models.
NLSstClosestXUses inverse linear interpolation to approximate thex value at which thefunction represented by xyis equal to yval.
NLSstLfAsymptoteProvides an initial guess at the horizontal asymptoteon the left side (i.e., small values of x) of the graph of y versus x from the xy object. Primarily used withininitial functions forself-starting nonlinear regression models.
NLSstRtAsymptoteProvides an initial guess at the horizontal asymptoteon the right side (i.e., large values of x) of the graph of y versus x from the xy object. Primarily used withininitial functions forself-starting nonlinear regression models.
PP.testComputes the Phillips-Perron test for the nullhypothesis that x has aunit root against a stationary alternative.
SSDFunction to compute the matrix of residual sums ofsquares and products, or the estimated variance matrix formultivariate linear models.
SSasympThis selfStart modelevaluates the asymptotic regression function and its gradient.It has an initial attributethat will evaluate initial estimates of the parametersAsym, R0, and lrc for a given set of data.
SSasympOffThis selfStart modelevaluates an alternative parametrization of the asymptoticregression function and the gradient with respect to thoseparameters. It has an initial attribute that createsinitial estimates of the parameters Asym, lrc, and c0.
SSasympOrigThis selfStart modelevaluates the asymptotic regression function through theorigin and its gradient. It has an initial attribute that will evaluateinitial estimates of the parameters Asym and lrc for a given set of data.
SSbiexpThis selfStart modelevaluates the biexponential model function and its gradient.It has an initial attributethat creates initial estimates of the parameters A1, lrc1, A2, and lrc2.
SSfolThis selfStart modelevaluates the first-order compartment function and itsgradient. It has an initialattribute that creates initial estimates of the parameterslKe, lKa, and lCl.
SSfplThis selfStart modelevaluates the four-parameter logistic function and itsgradient. It has an initialattribute that will evaluate initial estimates of theparameters A, B, xmid, and scal for a given set ofdata.
SSgompertzThis selfStart modelevaluates the Gompertz growth model and its gradient. It hasan initial attribute thatcreates initial estimates of the parameters Asym, b2, and b3.
SSlogisThis selfStart modelevaluates the logistic function and its gradient. It has aninitial attribute thatcreates initial estimates of the parameters Asym, xmid, and scal.
SSmicmenThis selfStart modelevaluates the Michaelis-Menten model and its gradient. It hasan initial attribute that willevaluate initial estimates of the parameters Vm and K.
SSweibullThis selfStart modelevaluates the Weibull model for growth curve data and itsgradient. It has an initialattribute that will evaluate initial estimates of theparameters Asym, Drop, lrc, and pwr for a given set of data.
StructTSFits a structural model for a time series by maximumlikelihood.
TukeyHSDCreates a set of confidence intervals on thedifferences between the means of the levels of a factor withthe specified family-wise probability of coverage. Theintervals are based on the Studentized range statistic, Tukey's honest significant difference method. There is aplot method.
TukeyHSD.aovCreates a set of confidence intervals on thedifferences between the means of the levels of a factor withthe specified family-wise probability of coverage. Theintervals are based on the Studentized range statistic, Tukey's honest significant difference method. There is aplot method.
acfThe function acfcomputes (and by default plots) estimates of theautocovariance or autocorrelation function. The functionpacf is the function usedfor partial autocorrelations. The function ccf computes the cross-correlationor cross-covariance oftwo univariate series.
acf2ARComputes an AR process exactly fitting anautocorrelation function.
add.scopeadd.scope anddrop.scope compute thoseterms that can be individually added to or dropped from amodel while respecting the hierarchy of terms.
add1Computes all the single terms in the scope argument that can be added toor dropped from the model, fits those models, and computes atable of the changes in fit.
addmarginsFor a given table, one can specify which of theclassifying factors to expand by one or more levels to holdmargins to be calculated. One may, for example, form sums andmeans over the first dimension and medians over the second.The resulting table will then have two extra levels for thefirst dimension and one extra level for the second. Thedefault is to sum over all margins in the table. Otherpossibilities may give results that depend on the order inwhich the margins are computed. This is flagged in the printedoutput from the function.
aggregateSplits the data into subsets, computes summarystatistics for each, and returns the result in a convenientform.
aliasFinds aliases (linearly dependent terms) in a linearmodel specified by a formula.
anovaComputes analysis of variance (or deviance) tables forone or more fitted model objects.
anova.lmlistComputes an analysis of variance table for one or morelinear model fits.
ansari.testPerforms the Ansari-Bradley two-sample test for adifference in scale parameters.
aovFits an analysis of variance model by a call tolm for eachstratum.
approxReturns a list of points that linearly interpolategiven data points, or a function performing the linear (orconstant) interpolation.
approxfunReturns a list of points that linearly interpolategiven data points, or a function performing the linear (orconstant) interpolation.
arFits an autoregressive time series model to the data, by default selecting the complexity by AIC.
arimaFits an ARIMA model to a univariate timeseries.
arima.simSimulates from an ARIMA model.
arima0Fits an ARIMA model to a univariate time series andforecasts from the fitted model.
as.dendrogramCoerces an object to class "dendrogram" (which provides generalfunctions for handling treelike structures).
as.distCoerces to a dist object (a matrix returned by the distfunction).
as.formulaThe generic function formula and its specific methodsprovide a way of extracting formulas that have been includedin other objects. as.formula is almost identical, additionally preserving attributes when object already inherits from"formula".
as.hclustConverts objects from other hierarchical clusteringfunctions to class "hclust".
as.stepfunGiven the vectors (x[1], ..., x[n]) and (y[0], y[1], ..., y[n]) (one value more!), stepfun(x, y, ...) returns an interpolating "step" function, sayfn. That is, fn(t) = c_i{[i]}(constant) for t in (x[i], x[i+1]) and at the abscissa values, if (by default) right =FALSE, fn(x_i) = y_i{fn(x[i]) =y[i]} and for right = TRUE, fn(x[i]) = y[i-1], for i=1, ..., n.
as.tsCoerces an object to a ts object.
asOneSidedFormulaNames, expressions, numeric values, and characterstrings are converted to one-sided formulas. If object is a formula, it must be onesided, in which case it is returned unaltered.
aveSubsets of x[] areaveraged, where each subset consists of those observationswith the same factor levels.
bandwidth.kernelReturns the equivalent bandwidth for a tskernel object.
bartlett.testPerforms Bartlett's test of the null that the variancesin each of the groups (samples) are the same.
binom.testPerforms an exact test of a simple null hypothesisabout the probability of success in a Bernoulliexperiment.
binomialFamily function for binomial distributions (used byfunctions such as glm).
biplotPlots a biplot on the current graphics device.
bw.SJ, bw.bcv, bw.nrd, bw.nrd0, bw.ucvBandwidth selectors for Gaussian kernels in density.
cancorComputes the canonical correlations between two datamatrices.
case.namesSimple utility returning (nonmissing) case names and(noneliminated) variable names.
ccfThe function acfcomputes (and by default plots) estimates of theautocovariance or autocorrelation function. The functionpacf is the function usedfor partial autocorrelations. The function ccf computes the cross-correlationor cross-covariance oftwo univariate series.
chisq.testPerforms chi-squared contingency table tests andgoodness-of-fit tests.
clearNamesSets the namesattribute of object toNULL and returns theobject.
cmdscaleClassical multidimensional scaling of a data matrix.Also known as principal coordinatesanalysis.
coef, coefficientscoef is a genericfunction that extracts model coefficients from objectsreturned by modeling functions. coefficients is an alias forit.
complete.casesReturns a logical vector indicating which cases arecomplete, i.e., have no missing values.
confintComputes confidence intervals for one or moreparameters in a fitted model.
constrOptimMinimizes a function subject to linear inequalityconstraints using an adaptive barrier algorithm.
contr.SAS, contr.helmert, contr.poly, contr.sum, contr.treatmentReturn a matrix of contrasts.
contrasts, contrasts<-Set and view the contrasts associated with afactor.
convolveUses the fast Fourier transform to compute the severalkinds of convolutions of two sequences.
cooks.distanceComputes "Cook's distance" on a model object.
copheneticComputes the cophenetic distances for a hierarchicalclustering.
corComputes the correlation of two vectors, or the columnsof two matrices.
cor.testTests for association between paired samples, using oneof Pearson's product-moment correlation coefficient, Kendall'stau, or Spearman's rho.
covComputes the covariance of two vectors, or the columnsof two matrices.
cov.wtReturns a list containing estimates of the weightedcovariance matrix and the mean of the data and optionally ofthe (weighted) correlation matrix.
cov2corvar, cov, and cor compute the variance of x and the covariance or correlationof x and y if these are vectors. If x and y are matrices, then the covariances(or correlations) between the columns of x and the columns of y are computed. cov2cor scales a covariance matrixinto the corresponding correlation matrixefficiently.
covratioReturns the covariance ratio (for regressiondiagnostics) on a model object.
cpgramPlots a cumulative periodogram.
cutreeCuts a tree, e.g., resulting from hclust, into several groups byspecifying either the desired number(s) of groups or the cutheight(s).
cycletime creates thevector of times at which a time series was sampled. cycle gives the positions in thecycle of each observation. frequency returns the number ofsamples per unit time, and deltat gives the timeinterval between observations (see ts).
dbetaDensity function for the Beta distribution.
dbinomDensity function for the binomial distribution.
dcauchyDensity function for the Cauchy distribution.
dchisqDensity function for the chi-squareddistribution.
decomposeDecomposes a time series into seasonal, trend, andirregular components using moving averages. Deals withadditive or multiplicative seasonal components.
delete.responseReturns a termsobject for the same model but with no responsevariable.
deltattime creates thevector of times at which a time series was sampled. cycle gives the positions in thecycle of each observation. frequency returns the number ofsamples per unit time, and deltat gives the timeinterval between observations (see ts).
dendrapplyApplies function FUNto each node of a dendrogram recursively. Wheny <- dendrapply(x, fn), then y is a dendrogram ofthe same graph structure as x and for each node, y.node[j] <- FUN(x.node[j], ...)(where y.node[j] is an(invalid!) notation for the jth node of y).
densityThe (S3) generic function density computes kernel densityestimates. Its default method does so with the given kerneland bandwidth for univariate observations.
density.defaultThe (S3) generic function density computes kernel densityestimates. Its default method does so with the given kerneland bandwidth for univariate observations.
deriv, deriv3Compute derivatives of simple expressions, symbolically.
devianceReturns the deviance of a fitted model object.
dexpDensity function for the exponentialdistribution.
dfDensity, distribution function, quantile function, andrandom generation for the F-distributionwith df1 and df2 degrees of freedom (and optionalnoncentrality parameter ncp).
df.kernelThe "tskernel" classis designed to represent discrete symmetric normalizedsmoothing kernels. These kernels can be used to smoothvectors, matrices, or time series objects. There are print, plot, and [ methods for these kernelobjects.
df.residualReturns the residual degrees of freedom extracted froma fitted model object.
dfbetaReturns dfbeta for a model object (for regressiondiagnostics).
dfbetasReturns dfbetas for a model object (for regressiondiagnostics).
dffitsReturns dffits for a model object (for regressiondiagnostics).
dgammaDensity function for the Gamma distribution.
dgeomDensity, distribution function, quantile function, andrandom generation for the geometric distribution withparameter prob.
dhyperDensity function for the hypergeometricdistribution.
diff.tsMethods for objects of class "ts", typically the result ofts.
diffinvComputes the inverse function of the lagged differencesfunction diff.
distComputes and returns the distance matrix computed byusing the specified distance measure to compute the distancesbetween the rows of a data matrix.
dlnormDensity function for the log-normaldistribution.
dlogisDensity function for the logistic distribution.
dmultinomGenerates multinomially distributed random numbervectors and computes multinomialprobabilities.
dnbinomDensity function for the negative binomialdistribution.
dnormDensity function for the normal distribution.
dpoisDensity function for the Poisson distribution.
drop.scopeadd.scope anddrop.scope compute thoseterms that can be individually added to or dropped from amodel while respecting the hierarchy of terms.
drop.termsdelete.responsereturns a terms object forthe same model, but with no response variable. drop.terms removes variables fromthe righthand side of the model. There is also a "[.terms" method to perform the samefunction (with keep.response=TRUE). reformulate creates aformula from a character vector.
drop1Computes all the single terms in the scope argument that can be added toor dropped from the model, fits those models, and computes atable of the changes in fit.
dsignrankDensity, distribution function, quantile function, andrandom generation for the distribution of the Wilcoxon signedrank statistic obtained from a sample with size n.
dtDensity, distribution function, quantile function, andrandom generation for the t-distributionwith df degrees of freedom(and optional noncentrality parameter ncp).
dummy.coefExtracts coefficients in terms of the original levelsof the coefficients rather than the coded variables.
dunifDensity function for the uniform distribution.
dweibullDensity function for the Weibull distribution.
dwilcoxDensity function for the distribution of the Wilcoxonrank sum statistic.
ecdfComputes or plots an empirical cumulative distributionfunction.
eff.aovlistComputes the efficiencies of fixed-effects terms in ananalysis of variance model with multiple strata.
effectsReturns (orthogonal) effects from a fitted model, usually a linear model. This is a generic function, butcurrently only has a method for objects inheriting fromclasses "lm" and "glm".
embedEmbeds the time series x into a low-dimensional Euclideanspace.
endExtracts and encodes the times the first and lastobservations were taken. Provided only for compatibility withS version 2.
estVarFunction to compute matrix of residual sums of squaresand products, or the estimated variance matrix formultivariate linear models.
expand.model.frameEvaluates new variables as if they had been part of theformula of the specified model. This ensures that the samena.action and subset arguments are applied andallows, for example, x tobe recovered for a model using sin(x) as a predictor.
extractAICComputes the (generalized) Akaike information criterionfor a fitted parametric model.
factanalPerforms maximum likelihood factor analysis on acovariance matrix or data matrix.
familyFamily objects provide a convenient way to specify thedetails of the models used by functions such as glm. See the documentation forglm for the details on howsuch model fitting takes place.
fftPerforms the fast Fourier transform of anarray.
filterApplies linear filtering to a univariate time series orto each series separately of a multivariate timeseries.
fisher.testPerforms Fisher's exact test for testing the null ofindependence of rows and columns in a contingency table withfixed marginals.
fitted, fitted.valuesfitted is a genericfunction that extracts fitted values from objects returned bymodeling functions. fitted.values is an alias forit.
fivenumReturns Tukey's five-number summary (minimum, lower-hinge, median, upper-hinge, maximum) for the inputdata.
fligner.testPerforms a Fligner-Killeen (median) test of the nullthat the variances in each of the groups (samples) are thesame.
formulaThe generic function formula and its specific methodsprovide a way of extracting formulas that have been includedin other objects.
frequencyReturns the number of samples per unit time from ats object.
friedman.testPerforms a Friedman rank sum test with unreplicatedblocked data.
ftableCreates "flat" contingency tables.
gaussianFamily object for Gaussian functions (used by functionssuch as glm).
getInitialEvaluates initial parameter estimates for a nonlinearregression model.
get_all_varsReturns a data.frame containing the variables used informula plus those specified. Unlike model.frame.default, it returns theinput variables and not those resulting from function calls informula.
glmUsed to fit generalized linear models, specified bygiving a symbolic description of the linear predictor and adescription of the error distribution.
glm.controlAuxiliary function as user interface for glm fitting. Typically only usedwhen calling glm orglm.fit.
glm.fitglm is used to fitgeneralized linear models, specified by giving a symbolicdescription of the linear predictor and a description of theerror distribution.
hasTsptsp returns thetsp attribute (or NULL). It is included forcompatibility with S version 2. tsp<- sets the tsp attribute. hasTsp ensures x has a tsp attribute, by adding one ifneeded.
hat, hatvalues, hatvalues.lmReturn the hat matrix for a model object (forregression diagnostics).
hclustHierarchical cluster analysis on a set ofdissimilarities and methods for analyzing it.
heatmapPlots a heat map object (an image with an accompanyingdendrogram).
influenceProvides the basic quantities that are used in forminga wide variety of diagnostics for checking the quality ofregression fits.
influence.measuresProduces a class "infl" object tabular display showingthe DFBETAS for each model variable, DFFITS, covarianceratios, Cook's distances, and the diagonal elements of the hatmatrix.
integrateAdaptive quadrature of functions of one variable over afinite or infinite interval.
interaction.plotPlots the mean (or other summary) of the response fortwo-way combinations of factors, thereby illustrating possibleinteractions.
inverse.gaussianFamily object for inverse Gaussian distributions (usedby functions such as glm).
is.empty.modelR model notation allows models with no intercept and nopredictors. These require special handling internally.is.empty.model() checkswhether an object describes an empty model.
is.leafClass "dendrogram"provides general functions for handling treelike structures.It is intended as a replacement for similar functions inhierarchical clustering and classification/regression trees, such that all of these can use the same engine for plotting orcutting trees. The code is still in the testing stage, and theAPI may change in the future.
is.mtsTells whether an object is of class mts.
is.stepfunTells whether an object is a function of class stepfun.
is.tsTells whether an object is of class ts.
is.tskernelTells whether an object is of class tskernel.
isoregComputes the isotonic (monotonically increasingnonparametric) least squares regression that is piecewiseconstant.
kernapplyComputes the convolution between an input sequence anda specific kernel.
kernelConstructs a general kernel or named specific kernels(returns a "tskernel" object).
kmeansPerforms k-means clustering on adata matrix.
knotsExtracts the knots from a step function (returned bystepfun).
kruskal.testPerforms a Kruskal-Wallis rank sum test.
ks.testPerforms one- or two-sample Kolmogorov-Smirnovtests.
ksmoothThe Nadaraya-Watson kernel regression estimate.
lagComputes a lagged version of a time series, shiftingthe time base back by a given number of observations.
lag.plotPlots time series against lagged versions ofthemselves. Helps visualizing "autodependence" even whenautocorrelations vanish.
lineFits a line robustly.
lines.tsPlotting method for objects inheriting from class"ts".
lmlm is used to fitlinear models. It can be used to carry out regression, single-stratum analysis of variance, and analysis ofcovariance (although aovmay provide a more convenient interface for these).
lm.fitBasic computing engines called by lm and used to fit linear models.These should usually not be used directlyunless by experienced users.
lm.influenceProvides the basic quantities that are used in forminga wide variety of diagnostics for checking the quality ofregression fits.
lm.wfitBasic computing engines called by lm and used to fit linear models.These should usually not be used directlyunless by experienced users.
loadingsExtracts or prints loadings in factor analysis (orprincipal components analysis).
loessFits a polynomial surface determined by one or morenumerical predictors, using local fitting.
loess.controlSets control parameters for loess fits.
loess.smoothPlots and adds a smooth curve computed by loess to a scatter plot.
logLikExtracts the log-likelihood value from an object(usually a model).
loglinUsed to fit log-linear models to multidimensionalcontingency tables by iterative proportional fitting.
lowessPerforms the computations for locally weighted scatterplot smoothing (LOWESS), smoother which uses locally weightedpolynomial regression.
ls.diagComputes basic statistics, including standard errors, t-, and p-values, for the regression coefficients.
ls.printComputes basic statistics, including standard errors, t-, and p-values, for the regression coefficients and prints them if print.it is TRUE.
lsfitFinds the least squares estimate of β in the modelY = Xβ + ε.
madComputes the median absolute deviation, i.e., the(lo-/hi-) median of the absolute deviations from the medianand (by default) adjusts by a factor for asymptotically normalconsistency.
mahalanobisReturns the squared Mahalanobis distance of all rows inx and the vectorμ = center with respect to Σ= cov. This is(for vector x) defined asD2 = (x - μ)'Σ-1 (x - μ).
make.linkThis function is used with the family functions in glm(). Given the name of a link, itreturns a link function, an inverse link function, thederivative dμ / dη and a function fordomain checking.
makeARIMAUses Kalman filtering to find the (Gaussian)log-likelihood, or for forecasting or smoothing.
makepredictcallUtility to help model.frame.default create the rightmatrices when predicting from models with terms like poly or ns.
manovaA class for the multivariate analysis ofvariance.
mantelhaen.testPerforms a Cochran-Mantel-Haenszel chi-squared test ofthe null that two nominal variables are conditionallyindependent in each stratum, assuming that there is nothree-way interaction.
mauchly.testTests whether a Wishart-distributed covariance matrix(or transformation thereof) is proportional to a givenmatrix.
mcnemar.testPerforms McNemar's chi-squared test for symmetry ofrows and columns in a two-dimensional contingencytable.
medianComputes the sample median.
median.defaultComputes the sample median.
medpolishFits an additive model using Tukey's median polishprocedure.
model.extractReturns the response, offset, subset, weights, or otherspecial components of a model frame passed as optionalarguments to model.frame.
model.framemodel.frame (ageneric function) and its methods return a data.frame with the variables neededto use formula and any... arguments.
model.matrixCreates a design matrix.
model.offsetReturns the offset of a model frame.
model.responseReturns the response of a model frame.
model.tablesComputes summary tables for model fits, especiallycomplex aov fits.
model.weightsReturns the weights of a model frame.
monthplotPlots seasonal (or other) subseries from a timeseries.
mood.testPerforms Mood's two-sample test for a difference inscale parameters.
mvfftPerforms the fast Fourier transform of anarray.
na.actionExtracts information on the NA action used to create anobject.
na.contiguousFinds the longest consecutive stretch of nonmissingvalues in a time series object. (In the event of a tie, thefirst such stretch.)
na.excludena.exclude returnsthe object with incomplete cases removed and with the na.action attribute set to"exclude". (Usually used as an na.action argument for a modelingfunction.)
na.failReturns the object if it does not contain any missingvalues and signals an error otherwise. (Usually used as anna.action argument for amodeling function.)
na.omitReturns the object with incomplete cases removed.(Usually used as an na.action argument for a modelingfunction.)
na.passReturns an object unchanged. (Usually used as anna.action argument for amodeling function.)
napredictUses missing value information to adjust residuals andpredictions.
naprintUses missing value information to report the effects ofan na.action.
naresidUses missing value information to adjust residuals andpredictions.
nextnReturns the smallest integer, greater than or equal ton, that can be obtained asa product of powers of the values contained in factors.
nlmCarries out a minimization of the function f using a Newton-typealgorithm.
nlminbUnconstrained and constrained optimization using PORTroutines.
nlsDetermines the nonlinear (weighted) least squaresestimates of the parameters of a nonlinear model.
nls.controlAllows the user to set some characteristics of thenonlinear least squares algorithm.
numericDerivNumerically evaluates the gradient of anexpression.
offsetAn offset is a term to be added to a linear predictor, such as in a generalized linear model, with known coefficient1 rather than an estimated coefficient.
oneway.testTests whether two or more samples from normaldistributions have the same means. The variances are notnecessarily assumed to be equal.
optimGeneral-purpose optimization based on Nelder-Mead, quasi-Newton, and conjugate-gradient algorithms.It includes an option for box-constrained optimization andsimulated annealing.
optimise, optimizeThe function optimize searches the interval fromlower to upper for a minimum or maximum ofthe function f with respectto its first argument. optimise is an alias for optimize.
order.dendrogramReturns the order (index) or the "label" attribute for the leaves ina dendrogram. These indices can then be used to access theappropriate components of any additional data.
p.adjustGiven a set of p-values, returnsp-values adjusted using one of severalmethods.
pacfComputes partial autocorrelations.
pairwise.prop.testCalculates pairwise comparisons between pairs ofproportions with correction for multiple testing.
pairwise.t.testCalculates pairwise comparisons between group levelswith corrections for multiple testing.
pairwise.tableCreates a table of p-values forpairwise comparisons with corrections for multipletesting.
pairwise.wilcox.testCalculates pairwise comparisons between group levelswith corrections for multiple testing.
pbetaDistribution function for the Betadistribution.
pbinomDistribution function for the binomialdistribution.
pbirthdayComputes the probability of a coincidence for ageneralized birthday paradox problem.
pcauchyDistribution function for the Cauchydistribution.
pchisqDistribution function for the chi-squareddistribution.
pexpDistribution function for the exponentialdistribution.
pfDistribution function for theF-distribution.
pgammaDistribution function for the Gammadistribution.
pgeomDistribution function for the geometricdistribution.
phyperDistribution function for the hypergeometricdistribution.
plclustHierarchical cluster analysis on a set ofdissimilarities and methods for analyzing it.
plnormDistribution function for the log-normaldistribution.
plogisDistribution function for the logisticdistribution.
plot.TukeyHSDCreates a set of confidence intervals on thedifferences between the means of the levels of a factor withthe specified family-wise probability of coverage. Theintervals are based on the Studentized range statistic, Tukey's honest significant difference method. There is aplot method.
plot.densityThe plot method fordensity objects.
plot.ecdfComputes or plots an empirical cumulative distributionfunction.
plot.lmPlots diagnostics for an lm object.
plot.mlmPlots diagnostics for an mlm object.
plot.spec, plot.spec.coherency, plot.spec.phasePlotting methods for objects of class "spec". For multivariate timeseries, they plot the marginal spectra of the series or pairsplots of the coherency and phase of the cross-spectra.
plot.stepfunMethod of the generic plot for stepfun objects and utility forplotting piecewise-constant functions.
plot.tsPlotting method for objects inheriting from class"ts".
pnbinomDistribution function for the negative binomialdistribution.
pnormDistribution function for the normaldistribution.
poissonFamily objects for Poisson distributions (used byfunctions such as glm).
poisson.testPerforms an exact test of a simple null hypothesisabout the rate parameter in a Poisson distribution or for theratio between two rate parameters.
poly, polymReturn or evaluate orthogonal polynomials of degree 1to degree over thespecified set of points x.These are all orthogonal to the constant polynomial of degree0. Alternatively, evaluate raw polynomials.
powerCreates a link object based on the link functionη =μλ.
power.anova.testComputes power of test or determines parameters toobtain target power.
power.prop.testComputes power of test or determines parameters toobtain target power.
power.t.testComputes power of test or determines parameters toobtain target power.
ppointsGenerates the sequence of probability points (1:m - a)/(m + (1-a)-a), wherem is either n, if length(n)==1, or length(n).
ppoisDistribution function for the Poissondistribution.
pprFits a projection pursuit regression model.
prcompPerforms a principal components analysis on the givendata matrix and returns the results as an object of classprcomp.
predictGeneric function for predictions from the results ofvarious model-fitting functions.
preplotComputes an object to be used for plots relating to thegiven model object.
princompPerforms a principal components analysis on the givennumeric data matrix and returns the results as an object ofclass princomp.
printCoefmatUtility function to be used in higher-level print methods, such as print.summary.lm, print.summary.glm, and print.anova. The goal is to providea flexible interface with smart defaults such that often onlyx needs to bespecified.
profileInvestigates the behavior of an objective function nearthe solution.
projReturns a matrix or list of matrices giving theprojections of the data onto the terms of a linear model. Itis most frequently used for aov models.
promaxThese functions "rotate" loading matrices in factoranalysis.
prop.testUsed for testing the null that the proportions(probabilities of success) in several groups are the same orthat they equal certain given values.
prop.trend.testPerforms a chi-squared test for trend in proportions, i.e., a test asymptotically optimal for local alternativeswhere the log odds vary in proportion with score. By default, score is chosen as the groupnumbers.
psignrankDistribution function for the distribution of theWilcoxon signed rank statistic.
ptDistribution function for thet-distribution.
ptukeyDistribution function for the Studentizedrange.
punifThese functions provide information about the uniformdistribution on the interval from min to max. dunif gives the density, punif gives the distributionfunction, qunif gives thequantile function, and runif generates randomdeviates.
pweibullDistribution function for the Weibulldistribution.
pwilcoxDistribution function for the distribution of theWilcoxon rank sum statistic.
qbetaQuantile function for the Beta distribution.
qbinomQuantile function for the binomialdistribution.
qbirthdayComputes the number of observations needed to have aspecified probability of coincidence for a generalizedbirthday paradox problem.
qcauchyQuantile function for the Cauchy distribution.
qchisqQuantile function for the chi-squareddistribution.
qexpQuantile function for the exponentialdistribution.
qfQuantile function for theF-distribution.
qgammaQuantile function for the Gamma distribution.
qgeomQuantile function for the geometricdistribution.
qhyperQuantile function for the hypergeometricdistribution.
qlnormQuantile function for the log-normaldistribution.
qlogisQuantile function for the logisticdistribution.
qnbinomQuantile function for the negative binomialdistribution.
qnormQuantile function for the normal distribution.
qpoisQuantile function for the Poisson distribution.
qqlineAdds a line to a normal Q-Q plot (usually generated byqqnorm or qqplot) that passes through the first and thirdquartiles.
qqnormGeneric function the default method of which produces anormal Q-Q plot of the values in y.
qqplotProduces a Q-Q plot of two data sets.
qsignrankDensity, distribution function, quantile function, andrandom generation for the distribution of the Wilcoxon signedrank statistic obtained from a sample with size n.
qtQuantile function for thet-distribution.
qtukeyFunction of the distribution of the Studentized range, R/s, where R is therange of a standard normal sample anddf∗s2 isindependently distributed as chi-squared withdf degrees of freedom; see pchisq.
quade.testPerforms a Quade test with unreplicated blockeddata.
quantileThe generic function quantile produces sample quantilescorresponding to the given probabilities. The smallestobservation corresponds to a probability of 0 and the largestto a probability of 1.
quantile.defaultThe generic function quantile produces sample quantilescorresponding to the given probabilities. The smallestobservation corresponds to a probability of 0 and the largestto a probability of 1.
quasiFamily object for the quasi distribution (used byfunctions such as glm).
quasibinomialFamily object for the quasibinomial distribution (usedby functions such as glm).
quasipoissonFamily object for the quasi-Poisson distribution (usedby functions such as glm).
qunifQuantile function for the uniform distribution.
qweibullQuantile function for the Weibull distribution.
qwilcoxQuantile function for the Wilcoxon rank sumstatistic.
r2dtableGenerates random two-way tables with given marginalsusing Patefield's algorithm.
rbetaRandom number generation for the Betadistribution.
rbinomRandom number generation for the binomialdistribution.
rcauchyRandom number generation for the Cauchydistribution.
rchisqRandom number generation for the chi-squareddistribution.
read.ftableReads, writes, and coerces "flat" contingencytables.
rect.hclustDraws rectangles around the branches of a dendrogram, highlighting the corresponding clusters. First, the dendrogramis cut at a certain level, and then a rectangle is drawnaround selected branches.
reformulateCreates a formula from a character vector.
relevelThe levels of a factor are reordered so that the levelspecified by ref is first, and the others are moved down. This is useful for contr.treatment contrasts, whichtake the first level as the reference.
reorderreorder is a genericfunction. Its "factor"method reorders the levels of a factor depending on values ofa second variable, usually numeric. The "character" method is a convenientalias.
replicationsReturns a vector or a list of the number of replicatesfor each term in the formula.
reshapeReshapes a data frame between "wide" format withrepeated measurements in separate columns of the same recordand "long" format with the repeated measurements in separaterecords.
residGeneric function that extracts model residuals fromobjects returned by modeling functions. The abbreviated formresid is an alias forresiduals.
residualsGeneric function that extracts model residuals fromobjects returned by modeling functions.
rexpRandom generation for the exponentialdistribution.
rfRandom generation for theF-distribution.
rgammaRandom generation for the Gamma distribution.
rgeomRandom generation for the geometricdistribution.
rhyperRandom generation for the hypergeometricdistribution.
rlnormRandom generation for the log-normaldistribution.
rlogisRandom generation for the logisticdistribution.
rmultinomGenerates multinomially distributed random numbervectors and computes multinomialprobabilities.
rnbinomRandom generation for the negative binomialdistribution.
rnormRandom generation for the normal distribution.
rpoisRandom generation for the Poisson distribution.
rsignrankRandom generation for the distribution of the Wilcoxonsigned rank statistic.
rstandardReturns the standardized residuals from a modelobject.
rstudentReturns the Studentized residuals from a modelobject.
rtRandom generation for thet-distribution.
runifGenerates random numbers from the uniformdistribution.
runmedComputes running medians of odd span. This is the "mostrobust" scatter plot smoothing possible. For efficiency (andhistorical reasons), you can use one of two differentalgorithms giving identical results.
rweibullRandom generation for the Weibull distribution.
rwilcoxRandom generation for the distribution of the Wilcoxonrank sum statistic.
scatter.smoothPlots and adds a smooth curve computed by loess to a scatter plot.
screeplotPlots the variances against the number of the principalcomponent. This is also the plot method for classes "princomp" and "prcomp".
sdComputes the standard deviation of the values inx.
se.contrastReturns the standard errors for one or more contrastsin an aov object.
selfStartConstructs self-starting nonlinear models.
setNamesThis is a convenience function that sets the names onan object and returns the object. It is most useful at the endof a function definition where one is creating the object to be returned andwould prefer not to store it under a name just so the namescan be assigned.
shapiro.testPerforms the Shapiro-Wilk test of normality.
simulateSimulates one or more responses from the distributioncorresponding to a fitted model object.
smoothTukey's smoothers, 3RS3R, 3RSS, 3R, etc.
smooth.splineFits a cubic smoothing spline to the supplieddata.
smoothEndsSmooths end points of a vector y using subsequently smaller mediansand Tukey's end point rule at the very end.
sortedXyDataThis is a constructor function for the class ofsortedXyData objects. Theseobjects are mostly usedin the initial function fora self-starting nonlinear regression model, which will be ofthe selfStart class.
spec.arFits an AR model to x (or uses the existing fit) andcomputes (and by default plots) the spectral density of thefitted model.
spec.pgramCalculates the periodogram using a fast Fouriertransform and optionally smooths the result with a series ofmodified Daniell smoothers (moving averages giving half weightto the end values).
spec.taperApplies a cosine-bell taper to a time series.
spectrumEstimates the spectral density of a timeseries.
splinePerforms cubic spline interpolation of given datapoints, returning either a list of points obtained by theinterpolation or a function performingthe interpolation. Returns a list containing componentsx and y, which give the ordinates whereinterpolation took place and the interpolated values.
splinefunPerforms cubic spline interpolation of given datapoints, returning either a list of points obtained by theinterpolation or a function performingthe interpolation. Returns a function with formal argumentsx and deriv, the latter defaulting to0.
splinefunHPerforms Hermite spline interpolation of given datapoints, returning either a list of points obtained by theinterpolation or a function performingthe interpolation.
startExtracts and encodes the times the first and lastobservations were taken. Provided only for compatibility withS version 2.
stat.anovaUtility function, used in lm and glm methods for anova(..., test != NULL) and shouldnot be used by the average user.
stepSelects a formula-based model by AIC.
stepfunReturns an interpolating step function from two sets ofvectors.
stlDecomposes a time series into seasonal, trend, andirregular components using loess.
supsmuSmooths the (x, y) values by Friedman'ssupersmoother.
symnumSymbolically encodes a given numeric or logical vectoror array. Particularly useful for visualization of structuredmatrices, e.g., correlation, sparse, or logical ones.
t.testPerforms one- and two-samplet-tests on vectors of data.
termplotPlots regression terms against their predictors, optionally with standard errors and partial residualsadded.
termsGeneric function that can be used to extractterms objects from various kinds of Rdata objects.
timeCreates the vector of times at which a time series wassampled.
toeplitzForms a symmetric Toeplitz matrix given its firstrow.
tsUsed to create time series objects.
ts.intersectBinds time series that have a common frequency.ts.intersect is restrictedto the time covered by all the series.
ts.plotPlots several time series on a common plot. Unlikeplot.ts, the series canhave different time bases, but they should have the samefrequency.
ts.unionBinds time series that have a common frequency.ts.union pads with NAs to the total timecoverage.
tsSmoothPerforms fixed-interval smoothing on a univariate timeseries via a state-space model.
tsdiagGeneric function to plot time seriesdiagnostics.
tsp, tsp<-tsp returns thetsp attribute (or NULL). It is included forcompatibility with S version 2. tsp<- sets the tsp attribute.
unirootSearches the interval from lower to upper for a root (i.e., 0) of thefunction f with respect toits first argument.
updateUpdates and (by default) refits a model. It does thisby extracting the call stored in the object, updating the calland (by default) evaluating that call.
varComputes the variance of a vector.
var.testPerforms an F-test to compare thevariances of two samples from normal populations.
variable.namesSimple utility returning (nonmissing) case names and(noneliminated) variable names.
varimaxThese functions "rotate" loading matrices in factoranalysis.
vcovReturns the variance-covariance matrix of the mainparameters of a fitted model object.
weighted.meanComputes a weighted mean of a numeric vector.
weighted.residualsComputes weighted residuals from a linear modelfit.
weightsAll these functions are methods for class "lm" objects.
wilcox.testPerforms one- and two-sample Wilcoxon tests on vectorsof data; the latter is also known as the Mann-Whitneytest.
window, window<-window is a genericfunction that extracts the subset of the object x observed between the timesstart and end. If a frequency is specified, the series is then resampled at the new frequency.
write.ftableReads, writes, and coerces "flat" contingencytables.
xtabsCreates a contingency table from cross-classifyingfactors, usually contained in a data frame, using a formulainterface.

Data Set

Data SetClassDescription
p.adjust.methodscharacterAllowed methods for p.adjust.

stats4

This package contains statistical functions using S4methods and classes.

Functions

FunctionDescription
AICCalculates the Akaike information criterion for one orseveral fitted model objects for which a log-likelihood valuecan be obtained.
BICCalculates the Bayesian information criterion (BIC), also known as Schwarz's Bayesian criterion (SBC), for one orseveral fitted model objects for which a log-likelihood valuecan be obtained, according to the formula −2 ∗ log-likelihood+ npar ∗log(nobs), wherenpar representsthe number of parameters andnobs the number ofobservations in the fitted model.
coefExtracts model coefficients from objects returned bymodeling functions.
confintComputes confidence intervals for one or moreparameters in a fitted model.
logLikExtracts the log-likelihood from a modelobject.
mleEstimates parameters by the method of maximumlikelihood.
plotGeneric function for plotting an R object.
profileInvestigates behavior of objective function near thesolution represented by fitted.
summaryGeneric function used to produce result summaries ofthe results of various model-fitting functions.
updateUpdates and (by default) refits a model.
vcovReturns the variance-covariance matrix of the mainparameters of a fitted model object.

survival

This package contains functions for survivalanalysis.

Functions

FunctionDescription
SurvCreates a survival object, usually used as a responsevariable in a model formula.
aaregReturns an object of class "aareg" that represents an Aalenmodel.
attrassignThe "assign"attribute on model matrices describes which columns come fromwhich terms in the model formula.
basehazComputes the baseline survival curve for a Coxmodel.
cchReturns estimates and standard errors from relativerisk regression fit to data from case-cohort studies, cohortdata, and Borgan II, a generalization of the Lin-Yingestimator.
clogitEstimates a logistic regression model by maximizing theconditional likelihood.
clusterThis is a special function used in the context ofsurvival models. It identifies correlated groups ofobservations and is used on the righthand side of aformula.
cox.zphTests the proportional hazards assumption for a Coxregression model fit (coxph).
coxphFits a Cox proportional hazards regressionmodel.
coxph.controlUsed to set various numeric parameters controlling aCox model fit. Typically, it would only be used in a call tocoxph.
coxph.detailReturns the individual contributions to the first andsecond derivative matrix, at each unique event time.
coxph.fitInternal survival function.
dsurvregDensity, cumulative probability, and quantiles for theset of distributions supported by the survreg function.
format.SurvCreates a survival object, usually used as a responsevariable in a model formula.
frailtyAdds a simple random-effects term to a Cox or survregmodel.
is.SurvTests for a survival object.
is.na.SurvTests for NA values in a survival object.
is.na.ratetableMatches variable names in data to those in a rate tablefor survexp.
is.ratetableVerifies not only the class attribute but also thestructure of the object.
labels.survregFinds a suitable set of labels from a survival objectfor use in printing or plotting, for example.
psplineSpecifies a penalized spline basis for thepredictor.
psurvregDensity, cumulative probability, and quantiles for theset of distributions supported by the survreg function.
pyearsComputes the person-years of follow-up time contributedby a cohort of subjects, stratified into subgroups.
qsurvregDensity, cumulative probability, and quantiles for theset of distributions supported by the survreg function.
ratetableMatches variable names in data to those in a rate tablefor survexp.
ridgeSpecifies a ridge regression term when used in a coxphor survreg model formula.
strataThis is a special function used in the context of theCox survival model. It identifies stratification variableswhen they appear on the righthand side of a formula.
survConcordanceComputes the concordance between a right-censoredsurvival time and a single continuous covariate.
survSplitGiven a survival data set and a set of specified cuttimes, splits each record into multiple subrecords at each cuttime. The new data set will be in "counting process" format, with a start time, stop time, and event status for eachrecord.
survdiffTests if there is a difference between two or moresurvival curves using theGρ family oftests, or for a single curve against a knownalternative.
survexpReturns either the expected survival of a cohort ofsubjects or the individual expected survival for eachsubject.
survfitComputes an estimate of a survival curve for censoreddata using either the Kaplan-Meier or the Fleming-Harringtonmethod or computes the predicted survivor function.
survobrienO'Brien's test for association of a single variablewith survival.
survregFits a parametric survival regression model. These arelocation-scale models for an arbitrary transform of the timevariable; the most common cases use a log transformation, leading to accelerated failure time models.
survreg.controlChecks and packages the fitting options for survreg.
survreg.fitInternal survival function.
survregDtestThis routine is called by survreg to verify that adistribution object is valid.
tcutAttaches categories for person-year calculations to avariable without losing the underlying continuousrepresentation.
untangle.specialsGiven a termsstructure and a desired special name, this returns an indexappropriate for subscripting the terms structure and anotherappropriate for the data frame.

Data Sets

Data SetClassDescription
amldata.frameSurvival in patients with acute myelogenousleukemia. The question at the time was whether the standardcourse of chemotherapy should be extended ("maintenance") foradditional cycles.
bladderdata.frameData on recurrences of bladder cancer, used by manypeople to demonstrate methodology for recurrent eventmodeling. Bladder1 is the full data set from the study. Thisdata set contains only the 85 subjects with nonzero follow-upwho were assigned to either thiotepa or placebo.
bladder1data.frameData on recurrences of bladder cancer, used by manypeople to demonstrate methodology for recurrent eventmodeling. Bladder1 is the full data set from the study. Itcontains all three treatment arms and all recurrences for 118subjects; the maximum observed number of recurrences is9.
bladder2data.frameData on recurrences of bladder cancer, used by manypeople to demonstrate methodology for recurrent eventmodeling. Bladder2 uses the same subset of subjects asbladder, but formatted in the (start, stop] or Anderson-Gillstyle.
cancerdata.frameSurvival in patients with advanced lung cancer from theNorth Central Cancer Treatment Group. Performance scores ratehow well the patient can perform normal dailyactivities.
cgddata.frameData is from a placebo controlled trial of gammainterferon in chronic granulotomous disease (CGD).
colondata.frameData from one of the first successful trials ofadjuvant chemotherapy for colon cancer.
heart, jasa, jasa1data.frameSurvival of patients on the waiting list for theStanford heart transplant program.
kidneydata.frameData on the recurrence times to infection, at the pointof insertion of the catheter, for kidney patients usingportable dialysis equipment.
leukemiadata.frameSurvival in patients with acute myelogenous leukemia.The question at the time was whether the standard course ofchemotherapy should be extended ("maintenance") for additionalcycles.
lungdata.frameSurvival in patients with advanced lung cancer from theNorth Central Cancer Treatment Group. Performance scores ratehow well the patient can perform normal dailyactivities.
mgus, mgus1, mgus2data.frameNatural history of 241 subjects with monoclonalgammapathy of undetermined significance (MGUS).
nwtcodata.frameMissing data/measurement error example. Tumor histologypredicts survival, but prediction is stronger with central labhistology than with the local institutiondetermination.
ovariandata.frameSurvival in a randomized trial comparing two treatmentsfor ovarian cancer.
pbcdata.frameThis data is from the Mayo Clinic trial in primarybiliary cirrhosis (PBC) of the liver conducted between 1974and 1984.
pbcseqdata.frameThis data is a continuation of the PBC data set andcontains the follow-up laboratory data for each studypatient.
ratsdata.frameForty-eight rats were injected with a carcinogen andthen randomized to either drug or placebo. The number oftumors ranged from 0 to 13; all rats were censored at 6 months afterrandomization.
stanford2data.frameThis contains the Stanford heart transplant data in adifferent format. The main data set is in heart.
survexp.mnratetableCensus data sets for the expected-survival andperson-year functions.
survexp.mnwhiteratetableCensus data sets for the expected-survival andperson-year functions.
survexp.usratetableCensus data sets for the expected-survival andperson-year functions.
survexp.usrratetableCensus data sets for the expected-survival andperson-year functions.
survreg.distributionslistList of distributions for accelerated failure models.These are location-scale families for some transformation oftime.
tobindata.frameEconomists fit a parametric censored data model calledthe tobit. The data come from Tobin'soriginal paper.
veterandata.frameRandomized trial of two treatment regimens for lungcancer. This is a standard survival analysis data set.

tcltk

The package contains interface and language bindings toTcl/Tk GUI elements. Please see the online help for more details.

tools

This package provides tools for developingpackages.

Functions

FunctionDescription
Rd2HTMLThis (experimental) function converts from an R helppage to an HTML document.
Rd2exThis (experimental) function converts from an R helppage to the format used by example.
Rd2latexThis (experimental) function converts from an R helppage to a LaTeX document.
Rd2txtThis (experimental) function converts from an R helppage to a text document.
Rd_dbBuilds a simple database of all R documentation (Rd)sources in a package, as a list of character vectors with thelines of the Rd files in the package.
RdiffGiven two R output files, computes differences, ignoring headers, footers, and some encodingdifferences.
RdindexPrints a two-column index table with names and titlesfrom given R documentation files to a given output file orconnection. The titles are nicely formatted between two columnpositions (typically 25 and 72, respectively).
buildVignettesRuns Sweave andtexi2dvi on all vignettesof a package.
checkDocFilesChecks, for all Rd files in a package, whether allarguments shown in the usage sections of the Rd file aredocumented in its arguments section.
checkDocStyleInvestigates how (S3) methods are shown in the usagesof the Rd files in a package.
checkFFPerforms checks on calls to compiled code from Rcode.
checkMD5sumsChecks the files against a file "MD5".
checkNEWSReads R's NEWS file or a similarly formatted one. Thisis an experimental feature, new in R 2.4.0, and may change inseveral ways.
checkRdThese experimental functions take the output of theparse_Rd function and checkit or produce a help page from it. Their interfaces (andexistence!) are subject to change.
checkReplaceFunsChecks whether replacement functions or S3/S4replacement methods in the package R code have their finalargument named value.
checkS3methodsChecks whether all S3 methods defined in the package Rcode have all arguments of the corresponding generic, withpositional arguments of the generics in the same positions forthe method.
checkTnFChecks the specified R package or code file foroccurrences of T orF and gathers theexpressions containing these.
checkVignettesChecks all Sweavefiles of a package by running Sweave and/or Stangle on them.
codocCompares names and optionally also correspondingpositions and default values of the arguments offunctions.
codocClassesFinds inconsistencies between actual and documented"structure" of R objects in a package. codoc compares names and optionallyalso corresponding positions and default values of thearguments of functions. codocClasses and codocData compare slot names of S4classes and variable names of data sets, respectively.
codocDataCompares slot names of S4 classes.
delimMatchMatches delimited substrings in a character vector, with proper nesting.
dependsOnPkgsFinds "reverse" dependencies of packages, i.e., thosepackages that depend on this one and (optionally) so onrecursively.
encoded_text_to_latexTranslates non-ASCII characters in text to LaTeX escapesequences.
file_path_as_absoluteTurns a possibly relative file path absolute, performing tilde expansion, if necessary.
file_path_sans_extReturns the file paths without extension.
findHTMLlinksFinds HTML links in an R help file.
getDepListGiven a dependency matrix, creates a DependsList object for that package, which will include the dependencies for that matrix, whichones are installed, which unresolved dependencies were foundonline, which unresolved dependencies were not found online, and any R dependencies.
installFoundDependsTakes the Foundelement of a pkgDependsListobject and attempts to install all of the listed packages fromthe specified repositories.
list_files_with_extsReturns the paths or names of the files in directorydir with extensions matching one of the elements ofexts.
list_files_with_typeReturns the paths of the files in dir of the given"type, " as determined by the extensions recognized byR.
md5sumComputes the 32-byte MD5 checksums of one or morefiles.
package.dependenciesParses and checks the dependencies of a package againstthe currently installed version of R (and otherpackages).
parse_RdReads an Rd file and parses it, for processing by otherfunctions. It is experimental.
pkgDependsConvenience function that wraps getDepList and takes asinput a package name.
pkgVignettesRuns Sweave andtexi2dvi on all vignettesof a package.
read.00IndexReads item/description information from 00Index-stylefiles.
readNEWSRead R's NEWS file or a similarly formatted one. Thisis an experimental feature, new in R 2.4.0, and may change inseveral ways.
showNonASCIIPrints elements of a character vector that containnon-ASCII bytes, printing such bytes as an escape like<fc>.
testInstalledBasicAllows an installed package to be tested by running thebasic tests.
testInstalledPackageAllows an installed package to be tested.
testInstalledPackagesAllows all base and recommended packages to betested.
texi2dviRuns latex andbibtex until allcross-references are resolved and creates either a deviceindependent (DVI) or a PDF file.
undocFinds the objects in a package that are undocumented, in the sense that they are visible to the user (or dataobjects or S4 classes provided by the package), but nodocumentation entry exists.
vignetteDependsGiven a vignette name, creates a DependsList objectthat reports information about the packages the vignettedepends on.
write_PACKAGESGenerates PACKAGESand PACKAGES.gz files for arepository of source or Mac/Windows binary packages.
xgettext, xgettext2pot, xngettextFor each file in the R directory (includingsystem-specific subdirectories) of a package, extract theunique arguments passed to stop, warning, message, gettext, and gettextf, or to ngettext.

Data Sets

Data SetClassDescription
Adobe_glyphsdata.frameA data frame that gives Adobe glyph names forUnicode points.
charset_to_UnicodehexmodeA matrix of Unicode points with columns for the common8-bit encodings.

utils

This package contains a variety of utility functions forR, including package management, file reading and writing, andediting.

Functions

FunctionDescription
?Documentation on a topic.
RShowDocUtility function to find and display Rdocumentation.
RSiteSearchSearches for keywords or phrases in the R-help mailinglist archives, help pages, vignettes, or task views, using thesearch engine at http://search.r-project.org, and displays theresults in a web browser.
RprofEnables or disables profiling of the execution of Rexpressions.
RprofmemEnables or disables reporting of memory allocation inR.
RtangleA driver for Stanglethat extracts R code chunks.
RtangleSetupA driver for Stanglethat extracts R code chunks.
RtangleWritedocThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
RweaveChunkPrefixThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
RweaveEvalWithOptThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
RweaveLatexA driver for Sweavethat translates R code chunks in LaTeX files.
RweaveLatexFinishThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
RweaveLatexOptionsThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
RweaveLatexSetupA driver for Sweavethat translates R code chunks in LaTeX files.
RweaveLatexWritedocThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
RweaveTryStopThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
StangleA frontend to Sweaveusing a simple driver by default, which discards thedocumentation and concatenates all code chunks the current Sengine understands.
SweaveSweave provides aflexible framework for mixing text and S code for automaticreport generation. The basic idea is to replace the S codewith its output, such that the final document only containsthe text and the output of the statistical analysis.
SweaveSyntConvThis function converts the syntax of files in Sweave format to another Sweavesyntax definition.
URLdecodeFunction to decode characters in URLs.
URLencodeFunction to encode characters in URLs.
ViewInvokes a spreadsheet-style data viewer on amatrix-like R object.
alarmGives an audible or visual signal to the user.
aproposapropos() returns acharacter vector giving the names of all objects in the searchlist matching a specified value.
argsAnywhereReturns the arguments for all functions with a namematching its argument, whether visible on the search path, registered as an S3 method, or in a namespace but notexported.
as.personA class and utility method for holding informationabout persons such as name and email address.
as.personListA class and utility method for holding informationabout persons such as name and email address.
as.relistablerelist() is an S3generic function with a few methods in order to allow easyinversion of unlist(obj)when that is used with an object of (S3) class "relistable".
as.romanManipulates integers as roman numerals.
assignInNamespaceUtility function to access and replace the nonexportedfunctions in a namespace, for use in developing packages withnamespaces.
available.packagesUsed to automatically compare the version numbers ofinstalled packages with the newest available version on therepositories and update outdated packages on the fly.
browseEnvOpens a browser with list of objects currently in thesys.frame()environment.
browseURLLoads a given URL into a web browser.
browseVignettesLists available vignettes in an HTML browser with linksto PDF, LaTeX/noweb source, and (tangled) R code (ifavailable).
bug.reportInvokes an editor to write a bug report and optionallymail it to the automated r-bugs repository atr-bugs@r-project.org. Some standardinformation on the current version and configuration of R areincluded automatically.
capture.outputEvaluates its arguments with the output being returnedas a character string or sent to a file. Related to sink in the same way that with is related to attach.
checkCRANFunctions helping to maintain CRAN, some of which mayalso be useful to administrators of other repositorynetworks.
chooseCRANmirrorInteracts with the user to choose a CRANmirror.
citEntryCreates "citation" objects, which are modeled afterBibTeX entries.
citFooterCreates a footer in a CITATION file.
citHeaderCreates a header in a CITATION file.
citationShows how to cite R and R packages inpublications.
close.socketCloses the socket and frees the space in the filedescriptor table. The port may not be freedimmediately.
combnGenerates all combinations of the elements of x taken m at a time. If x is a positive integer, returns allcombinations of the elements of seq(x) taken m at a time. If argument FUN is not NULL, applies a function given bythe argument to each point. If simplify is FALSE, returns alist; otherwise, returns an array, typically a matrix. ... are passed unchanged to theFUN function, ifspecified.
compareVersionCompares two package version numbers to see which islater.
contrib.urlUsed to automatically compare the version numbers ofinstalled packages with the newest available version on therepositories and update outdated packages on the fly.
count.fieldsCounts the number of fields, as separated by sep, in each of the lines offile read.
dataLoads specified data sets or lists the available datasets.
data.entry, dataentry, de, de.ncols, de.restore, de.setupSpreadsheet-like editors for entering or editingdata.
debuggerFunction to dump the evaluation environments (frames)and to examine dumpedframes.
demoUser-friendly interface for running some demonstrationR scripts. demo() gives thelist of available topics.
download.fileUsed to download a file from the Internet.
download.packagesUsed to automatically compare the version numbers ofinstalled packages with the newest available version on therepositories and update outdated packages on the fly.
dump.framesFunction to dump the evaluation environments (frames)and to examine dumpedframes.
editInvokes an editor on an R object.
emacsInvokes the text editor emacs on an R object.
exampleRuns all the R code from theExamples part of R's online help.
file.editEdits one or more files in a text editor.
file_testUtility for shell-style file tests.
findReturns a character vector giving the names of allobjects in the search list matching a given value.
fixInvokes edit onx and assigns the new(edited) version of x inthe user's workspace.
fixInNamespaceUtility function to access and replace the nonexportedfunctions in a namespace, for use in developing packages withnamespaces.
flush.consoleOn the Mac OS X and Windows GUIs, ensures that thedisplay of output in the console is current, even if outputbuffering is on. (This does nothing except on console-basedversions of R.)
formatOL, formatULFormat unordered (itemize) and ordered (enumerate)lists.
getAnywhereLocates and returns all objects with a name matchingits argument, whether visible on the search path, registeredas an S3 method, or in a namespace but not exported.
getCRANmirrorsInteracts with the user to choose a CRANmirror.
getFromNamespaceUtility function to access and replace the nonexportedfunctions in a namespace, for use in developing packages withnamespaces.
getS3methodGets a method for an S3 generic, possibly from anamespace.
getTxtProgressBarText progress bar in the R console.
glob2rxChanges wildcard (akaglobbing) patterns into the correspondingregular expressions (regexp).
headReturns the first or last parts of a vector, matrix, table, data frame, or function. Since head() and tail() are generic functions, theymay also have been extended to other classes.
helpThe primary interface to R's help system.
help.requestPrompts users to check they have done all that isexpected of them before sending a post to the R-help mailinglist, provides a template for the post with sessioninformation included, and optionally sends the email (on Unixsystems).
help.searchAllows for searching the help system for documentationmatching a given character string in the (file) name, alias, title, concept, or keyword entries (or any combinationthereof), using either fuzzy matching or regular expressionmatching. Names and titles of the matched help entries aredisplayed nicely formatted.
help.startStarts the hypertext (currently HTML) version of R'sonline documentation.
historyLoads or saves or displays the commandshistory.
index.searchUsed to search the indexes for help files, possiblyunder aliases.
install.packagesUsed to automatically compare version numbers ofinstalled packages with the newest available version on therepositories and update outdated packages on the fly.
installed.packagesFinds (or retrieves) details of all packages installedin the specified libraries.
is.relistablerelist() is an S3generic function with a few methods in order to allow easyinversion of unlist(obj)when that is used with an object of (S3) class "relistable".
limitedLabelsAllows the user to browse directly on any of thecurrently active function calls and is suitable as an erroroption. The expression options(error=recover) will makethis the error option.
loadhistoryLoads or saves or displays the commandshistory.
localeToCharsetAims to find a suitable coding for the locale named, bydefault the current locale, and if it is a UTF-8 locale, asuitable single-byte encoding.
ls.str, lsf.strls.str and lsf.str are variations of ls applying str() to each matched name.
make.packages.htmlUpdates HTML documentation files.
make.socketWith server = FALSE, attempts to open a client socket to the specified port andhost. With server = TRUE, listens on the specified port for a connection and thenreturns a server socket. It is a good idea to use on.exit to ensure that a socket isclosed, as you only get 64 of them.
makeRweaveLatexCodeRunnerThese functions are handy for writing Sweave driversand currently not documented. Look at the source code of theSweave Latex driver (in this package) or the HTML driver (inthe R2HTML package from CRAN) to see how they can beused.
memory.limitGets or sets the memory limit on Microsoft Windowsplatforms.
memory.sizeChecks the current memory usage on Microsoft Windowsplatforms.
menuPresents the user with a menu of choices labeled from 1to the number of choices. To exit without choosing an item, select 0.
methodsLists all available methods for an S3 generic functionor all methods for a class.
mirror2htmlFunctions helping to maintain CRAN, some of which mayalso be useful to administrators of other repositorynetworks.
modifyListModifies a possibly nested list recursively by changinga subset of elements at each level to match a secondlist.
new.packagesUsed to automatically compare the version numbers ofinstalled packages with the newest available version on therepositories and update outdated packages on the fly.
normalizePathConverts file paths to canonical form for the platform, to display them in a user-understandable form.
nslInterface to gethostbyname.
object.sizeProvides an estimate of the memory that is being usedto store an R object.
old.packagesUsed to automatically compare the version numbers ofinstalled packages with the newest available version on therepositories and update outdated packages on the fly.
package.skeletonAutomates some of the setup for a new source package.It creates directories; saves functions, data, and R codefiles to appropriate places; and creates skeleton help filesand a Read-and-delete-mefile describing further steps in packaging.
packageDescriptionParses and returns the DESCRIPTION file of apackage.
packageStatusSummarizes information about installed packages andpackages available at various repositories, and automaticallyupgrades outdated packages.
pageDisplays a representation of the object named byx in a pager via file.show.
personCreates a "person" object.
personListCreates a "personList" object.
picoInvokes a text editor on an R object.
promptFacilitates the construction of files documenting Robjects.
promptDataGenerates a shell of documentation for a dataset.
promptPackageGenerates a shell of documentation for an installed orsource package.
read.DIFReads a file in Data Interchange Format (DIF) andcreates a data frame from it. DIF is a format for datamatrices such as single spreadsheets.
read.csv, read.csv2, read.delim, read.delim2Read a file in table format and create a data framefrom it, with cases corresponding to lines and variables tofields in the file.
read.fortranReads fixed-format data files using FORTRAN-styleformat specifications.
read.fwfReads a table of fixed-width-formatted data into adata.frame.
read.socketread.socket reads astring from the specified socket; write.socket writes to the specifiedsocket. There is very little error checking done byeither.
read.tableReads a file in table format and creates a data framefrom it, with cases corresponding to lines and variables tofields in the file.
readCitationFileThe CITATION fileof R packages contains an annotated list of references thatshould be used for citing the packages.
recoverAllows the user to browse directly on any of thecurrently active function calls and is suitable as an erroroption. The expression options(error=recover) will makethis the error option.
relistrelist() is an S3generic function with a few methods in order to allow easyinversion of unlist(obj)when that is used with an object of (S3) class "relistable".
remove.packagesRemoves installed packages/bundles and updates indexinformation as necessary.
rtagsProvides etags-like indexing capabilities for R code, using R's own parser.
savehistoryLoads or saves or displays the commandshistory.
select.listSelects item(s) from a character vector.
sessionInfoPrints version information about R and attached orloaded packages.
setRepositoriesInteracts with the user to choose the packagerepositories to be used.
setTxtProgressBarText progress bar in the R console.
stackStacking vectors concatenates multiple vectors into asingle vector along with a factor indicating where eachobservation originated; unstacking reverses this.
strCompactly displays the internal structure of an Robject; the idea is to give reasonable output forany R object.
strOptionsstrOptions() is aconvenience function for setting options(str = .).
summaryRprofSummarizes the output of the Rprof function to show the amount oftime used by different R functions.
tailReturns the first or last parts of a vector, matrix, table, data frame, or function. Since head() and tail() are generic functions, theymay also have been extended to other classes.
timestampLoads or saves or displays the commandshistory.
toBibtexConverts R objects to character vectors with BibTeXmarkup.
toLatexConverts R objects to character vectors with LaTeXmarkup.
txtProgressBarText progress bar in the R console.
type.convertConverts a character vector to logical, integer, numeric, complex, or factor, as appropriate.
unstackStacking vectors concatenates multiple vectors into asingle vector along with a factor indicating where eachobservation originated; unstacking reverses this.
unzipExtracts files from or lists a zip archive.
update.packageStatusSummarizes information about installed packages andpackages available at various repositories and automaticallyupgrades outdated packages.
update.packagesUsed to automatically compare the version numbers ofinstalled packages with the newest available version on therepositories and update outdated packages on the fly.
upgradeSummarizes information about installed packages andpackages available at various repositories and automaticallyupgrades outdated packages.
url.showExtension of file.show to display text files froma remote server.
viInvokes a text editor on an R object.
vignetteViews a specified vignette or lists the availableones.
write.csv, write.csv2Convenience wrappers to write.table for producing CSV filesfrom an R object.
write.socketread.socket reads astring from the specified socket; write.socket writes to the specifiedsocket. There is very little error checking done byeither.
write.tablePrints its required argument x (after converting it to a dataframe if it is not one nor a matrix) to a file orconnection.
wsbrowserThe browseEnvfunction opens a browser with list of objects currently in thesys.frame()environment.
xeditInvokes the xedit editor on an R object.
xemacsInvokes the xemacs editor on an R object.
zip.file.extractExtracts the file named file from the zip archive, ifpossible, and writes it in a temporary location.

Copyright © 2009 O'Reilly Media, Inc.