The R Reference Manual Base Package Volume 2
Total Page:16
File Type:pdf, Size:1020Kb
The R Reference Manual Base Package Volume 2 The R Development Core Team Version 1.8.1 A catalogue record for this book is available from the British Library. First printing, January 2004 (24/1/2004). Published by Network Theory Limited. 15 Royal Park Bristol BS8 3AL United Kingdom Email: [email protected] ISBN 0-9546120-1-9 Further information about this book is available from http://www.network-theory.co.uk/R/reference/ Copyright (C) 1999–2003 R Development Core Team. Permission is granted to make and distribute verbatim copies of this man- ual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the en- tire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the R Development Core Team. Contents Publisher’s Preface 1 1 Base package — graphics 5 abline............................. 6 arrows............................. 8 assocplot........................... 10 axis.............................. 12 axis.POSIXct......................... 15 axTicks............................ 17 barplot............................. 19 box............................... 23 boxplot............................ 24 boxplot.stats ......................... 28 bxp............................... 30 chull.............................. 33 col2rgb ............................. 35 colors ............................. 37 contour............................ 38 coplot............................. 42 curve.............................. 46 dev.xxx............................ 48 dev2.............................. 50 dev2bitmap.......................... 53 Devices............................ 55 dotchart............................ 57 filled.contour......................... 59 fourfoldplot.......................... 62 frame............................. 65 Gnome............................. 66 gray.............................. 68 grid.............................. 69 gtk............................... 71 i ii CONTENTS Hershey............................ 72 hist............................... 76 hsv............................... 80 identify............................ 82 image............................. 84 interaction.plot ........................ 87 Japanese............................ 90 jitter .............................. 91 layout............................. 93 legend............................. 96 lines.............................. 102 locator ............................. 104 matplot............................ 106 mosaicplot........................... 110 mtext............................. 114 n2mfrow............................ 117 pairs.............................. 118 palette............................. 121 Palettes............................ 123 panel.smooth......................... 125 par............................... 126 pdf............................... 135 persp.............................. 137 pictex............................. 141 pie............................... 143 plot.............................. 145 plot.data.frame ........................ 147 plot.default .......................... 148 plot.density .......................... 152 plot.design ........................... 153 plot.factor ........................... 156 plot.formula .......................... 157 plot.histogram ........................ 159 plot.lm ............................. 161 plot.table ........................... 164 plot.ts ............................. 166 plot.window .......................... 168 plot.xy ............................. 170 plotmath ........................... 171 png............................... 175 points............................. 178 polygon............................ 181 postscript........................... 184 CONTENTS iii ppoints............................ 190 preplot............................. 191 pretty............................. 192 qqnorm............................ 194 quartz............................. 196 recordPlot........................... 197 rect.............................. 198 rgb............................... 201 rug............................... 202 screen............................. 204 segments............................ 207 stars.............................. 209 stripchart........................... 213 strwidth............................ 215 sunflowerplot ......................... 217 symbols............................ 220 termplot............................ 223 text.............................. 225 title .............................. 228 units.............................. 230 x11............................... 231 xfig............................... 233 xy.coords........................... 235 xyz.coords........................... 237 2 Base package — math 239 abs............................... 240 all.equal ............................ 241 approxfun........................... 243 Arithmetic........................... 246 backsolve........................... 248 Bessel............................. 250 chol.............................. 253 chol2inv ............................ 256 colSums............................ 258 convolve............................ 260 crossprod........................... 262 cumsum............................ 263 deriv.............................. 264 eigen.............................. 267 Extremes........................... 270 fft............................... 272 findInterval .......................... 274 iv CONTENTS gl................................ 276 Hyperbolic .......................... 277 integrate............................ 278 kappa............................. 281 log............................... 283 matmult............................ 285 matrix............................. 286 nextn............................. 288 poly.............................. 289 polyroot............................ 291 prod.............................. 293 qr............................... 294 QR.Auxiliaries ........................ 297 range.............................. 299 Round............................. 301 sign.............................. 303 solve.............................. 304 sort.............................. 306 Special............................. 309 splinefun............................ 311 sum.............................. 314 svd............................... 315 tabulate ............................ 317 Trig.............................. 318 3 Base package — distributions and random numbers 319 bandwidth........................... 320 Beta.............................. 322 Binomial............................ 324 birthday............................326 Cauchy............................ 328 Chisquare........................... 330 density ............................. 333 Exponential .......................... 338 FDist............................. 340 GammaDist.......................... 342 Geometric...........................344 Hypergeometric........................ 346 Logistic ............................ 348 Lognormal........................... 350 Multinomial .......................... 352 NegBinomial......................... 354 Normal............................ 357 CONTENTS v Poisson............................ 359 r2dtable............................ 361 Random............................ 363 Random.user......................... 368 sample............................. 370 SignRank........................... 372 TDist............................. 374 Tukey............................. 376 Uniform............................ 378 Weibull............................ 380 Wilcoxon........................... 382 4 Base package — models 385 add1.............................. 386 AIC.............................. 389 alias .............................. 391 anova............................. 394 anova.glm ........................... 395 anova.lm ............................ 397 aov............................... 399 AsIs.............................. 401 C................................ 403 case/variable.names..................... 405 coef.............................. 407 confint............................. 408 constrOptim.......................... 410 contrast............................ 413 contrasts............................ 415 deviance............................ 417 df.residual........................... 418 dummy.coef.......................... 419 eff.aovlist........................... 421 effects ............................. 423 expand.grid.......................... 425 expand.model.frame..................... 426 extractAIC.......................... 428 factor.scope.......................... 430 family............................. 432 fitted.............................. 435 formula............................ 436 glm............................... 439 glm.control.......................... 445 glm.summaries........................ 447 vi CONTENTS influence.measures ...................... 449 is.empty.model........................ 453 labels............................. 454 lm............................... 455 lm.fit.............................. 459 lm.influence .......................... 461 lm.summaries......................... 464 logLik ............................. 466 logLik.glm ..........................