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

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.

Pages: 1, 2, 3, 4, 5

Next Pagearrow