R version 2.9.2 (2009-08-24) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > options(STERM='iESS', editor='emacsclient') > c(1,2,3) [1] 1 2 3 > x <- c(1,2,3) > x [1] 1 2 3 > x [1] 1 2 3 > x[2] [1] 2 > y <- c("Jane", "Joe", "Bill") > y[2] [1] "Joe" > y <- c("Jane", "Joe", "Bill") > y [1] "Jane" "Joe" "Bill" > x+x [1] 2 4 6 > x [1] 1 2 3 > x+x [1] 2 4 6 > 2*x [1] 2 4 6 > sum(x*x) [1] 14 > x=c(1,2,3) > y=c(7,1,-1) > x*y [1] 7 2 -3 > sum(x*y) [1] 6 > crossprod(x,y) [,1] [1,] 6 > 1:10 [1] 1 2 3 4 5 6 7 8 9 10 > x=1:10 > x [1] 1 2 3 4 5 6 7 8 9 10 > c(1,2,3,4,5,6,7,8,9,10) [1] 1 2 3 4 5 6 7 8 9 10 > seq(1,100) [1] 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 [26] 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 > seq(1,100) [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 [37] 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 [55] 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 [73] 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 [91] 91 92 93 94 95 96 97 98 99 100 > seq(1,100,2) [1] 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 [26] 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 > ?seq > seq(from=1,to=10) [1] 1 2 3 4 5 6 7 8 9 10 > seq(to=10, from=1) [1] 1 2 3 4 5 6 7 8 9 10 > seq(to=10, from=1, 2) [1] 1 3 5 7 9 > seq(to=10, from=1, by=2) [1] 1 3 5 7 9 > seq(to=10, from=1, length.out=30) [1] 1.000000 1.310345 1.620690 1.931034 2.241379 2.551724 2.862069 [8] 3.172414 3.482759 3.793103 4.103448 4.413793 4.724138 5.034483 [15] 5.344828 5.655172 5.965517 6.275862 6.586207 6.896552 7.206897 [22] 7.517241 7.827586 8.137931 8.448276 8.758621 9.068966 9.379310 [29] 9.689655 10.000000 > example(seq) seq> seq(0, 1, length.out=11) [1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 seq> seq(stats::rnorm(20)) [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 seq> seq(1, 9, by = 2) # match [1] 1 3 5 7 9 seq> seq(1, 9, by = pi)# stay below [1] 1.000000 4.141593 7.283185 seq> seq(1, 6, by = 3) [1] 1 4 seq> seq(1.575, 5.125, by=0.05) [1] 1.575 1.625 1.675 1.725 1.775 1.825 1.875 1.925 1.975 2.025 2.075 2.125 [13] 2.175 2.225 2.275 2.325 2.375 2.425 2.475 2.525 2.575 2.625 2.675 2.725 [25] 2.775 2.825 2.875 2.925 2.975 3.025 3.075 3.125 3.175 3.225 3.275 3.325 [37] 3.375 3.425 3.475 3.525 3.575 3.625 3.675 3.725 3.775 3.825 3.875 3.925 [49] 3.975 4.025 4.075 4.125 4.175 4.225 4.275 4.325 4.375 4.425 4.475 4.525 [61] 4.575 4.625 4.675 4.725 4.775 4.825 4.875 4.925 4.975 5.025 5.075 5.125 seq> seq(17) # same as 1:17 [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 > help("seq") > help.search("plot") Help files with alias or concept or title matching ‘plot’ using regular expression matching: base::base-defunct Defunct Functions in Base Package boot::glm.diag.plots Diagnostics plots for generalized linear models boot::jack.after.boot Jackknife-after-Bootstrap Plots boot::lines.saddle.distn Add a Saddlepoint Approximation to a Plot boot::plot.boot Plots of the Output of a Bootstrap Simulation class::somgrid Plot SOM Fits cluster::bannerplot Plot Banner (of Hierarchical Clustering) cluster::clusplot Cluster Plot - Generic Function cluster::clusplot.default Bivariate Cluster Plot (clusplot) Default Method cluster::clusplot.partition Bivariate Clusplot of a Partitioning Object cluster::plot.agnes Plots of an Agglomerative Hierarchical Clustering cluster::plot.diana Plots of a Divisive Hierarchical Clustering cluster::plot.mona Banner of Monothetic Divisive Hierarchical Clusterings cluster::plot.partition Plot of a Partition of the Data Set cluster::silhouette Compute or Extract Silhouette Information from Clustering GeneR::as.segSet Segments Set manipulation GeneR::densityProfile Density profiles GeneR::plot.globalSeg Plot an object of class globalSeg graphics::abline Add Straight Lines to a Plot graphics::arrows Add Arrows to a Plot graphics::assocplot Association Plots graphics::axis.POSIXct Date and Date-time Plotting Functions graphics::axis Add an Axis to a Plot graphics::barplot Bar Plots graphics::box Draw a Box around a Plot graphics::boxplot Box Plots graphics::boxplot.matrix Draw a Boxplot for each Column (Row) of a Matrix graphics::bxp Draw Box Plots from Summaries graphics::cdplot Conditional Density Plots graphics::coplot Conditioning Plots graphics::curve Draw Function Plots graphics::dotchart Cleveland Dot Plots graphics::filled.contour Level (Contour) Plots graphics::fourfoldplot Fourfold Plots graphics::plot.new Create / Start a New Plot Frame graphics::graphics-defunct Defunct Functions in Package graphics graphics::grid Add Grid to a Plot graphics::identify Identify Points in a Scatter Plot graphics::layout Specifying Complex Plot Arrangements graphics::legend Add Legends to Plots graphics::lines Add Connected Line Segments to a Plot graphics::matplot Plot Columns of Matrices graphics::mosaicplot Mosaic Plots graphics::mtext Write Text into the Margins of a Plot graphics::pairs Scatterplot Matrices graphics::panel.smooth Simple Panel Plot graphics::persp Perspective Plots graphics::plot Generic X-Y Plotting graphics::plot.data.frame Plot Method for Data Frames graphics::plot.design Plot Univariate Effects of a 'Design' or Model graphics::plot.table Plot Methods for 'table' Objects graphics::plot.window Set up World Coordinates for Graphics Window graphics::plot.xy Basic Internal Plot Function graphics::plot.default The Default Scatterplot Function graphics::plot.factor Plotting Factor Variables graphics::plot.formula Formula Notation for Scatterplots graphics::plot.histogram Plot Histograms graphics::points Add Points to a Plot graphics::rug Add a Rug to a Plot graphics::segments Add Line Segments to a Plot graphics::smoothScatter Scatterplots with Smoothed Densities Color Representation graphics::spineplot Spine Plots and Spinograms graphics::stars Star (Spider/Radar) Plots and Segment Diagrams graphics::stem Stem-and-Leaf Plots graphics::stripchart 1-D Scatter Plots graphics::strwidth Plotting Dimensions of Character Strings and Math Expressions graphics::sunflowerplot Produce a Sunflower Scatter Plot graphics::symbols Draw Symbols (Circles, Squares, Stars, Thermometers, Boxplots) on a Plot graphics::text Add Text to a Plot graphics::title Plot Annotation graphics::Axis Generic function to add an Axis to a Plot grDevices::boxplot.stats Box Plot Statistics grDevices::densCols Colors for Smooth Density Plots grDevices::n2mfrow Compute Default mfrow From Number of Plots grDevices::plotmath Mathematical Annotation in R grDevices::replayPlot Record and Replay Plots grDevices::trans3d 3D to 2D Transformation for Perspective Plots grDevices::xy.coords Extracting Plotting Structures grDevices::xyTable Multiplicities of (x,y) Points, e.g., for a Sunflower Plot grDevices::xyz.coords Extracting Plotting Structures grDevices::savePlot Save Cairo X11 Plot to File grid::grid.plot.and.legend A Simple Plot and Legend Demo grid::plotViewport Create a Viewport with a Standard Plot Layout Hmisc::Ecdf Empirical Cumulative Distribution Plot Hmisc::areg Additive Regression with Optimal Transformations on Both Sides using Canonical Variates Hmisc::aregImpute Multiple Imputation using Additive Regression, Bootstrapping, and Predictive Mean Matching Hmisc::biVar Bivariate Summaries Computed Separately by a Series of Predictors Hmisc::bpplot Box-percentile plots Hmisc::curveRep Representative Curves Hmisc::errbar Plot Error Bars Hmisc::gbayes Gaussian Bayesian Posterior and Predictive Distributions Hmisc::labcurve Label Curves, Make Keys, and Interactively Draw Points and Curves Hmisc::label Label Attribute of an Object Hmisc::ldBands Group Sequential Boundaries using the Lan-DeMets Approach Hmisc::panel.bpplot Box-Percentile Panel Function for Trellis Hmisc::plotCorrPrecision Plot Precision of Estimate of Pearson Correlation Coefficient Hmisc::plsmo Plot smoothed estimates Hmisc::pstamp Date/Time/Directory Stamp the Current Plot Hmisc::rcspline.plot Plot Restricted Cubic Spline Function Hmisc::rm.boot Bootstrap Repeated Measurements Model Hmisc::show.pch Display Colors, Plotting Symbols, and Symbol Numeric Equivalents Hmisc::spower Simulate Power of 2-Sample Test for Survival under Complex Conditions Hmisc::summary.formula Summarize Data for Making Tables and Plots Hmisc::transace Additive Regression and Transformations using ace or avas Hmisc::transcan Transformations/Imputations using Canonical Variates Hmisc::varclus Variable Clustering Hmisc::xYplot xyplot and dotplot with Matrix Variables to Plot Error Bars and Bands lattice::barchart.table table methods for barchart and dotplot lattice::cloud 3d Scatter Plot and Wireframe Surface Plot lattice::draw.colorkey Produce a Colorkey for levelplot lattice::histogram Histograms and Kernel Density Plots lattice::panel.identify Functions to Interact with Lattice Plots lattice::levelplot Level plots and contour plots lattice::llines Replacements of traditional graphics functions lattice::panel.bwplot Default Panel Function for bwplot lattice::panel.densityplot Default Panel Function for densityplot lattice::panel.dotplot Default Panel Function for dotplot lattice::panel.levelplot Default Panel Function for levelplot lattice::current.row Accessing Auxiliary Information During Plotting lattice::panel.stripplot Default Panel Function for stripplot lattice::panel.violin Panel Function to create Violin Plots lattice::panel.xyplot Default Panel Function for xyplot lattice::prepanel.default.bwplot Default Prepanel Functions lattice::print.trellis Plot and Summarize Trellis Objects lattice::qq Quantile-Quantile Plots of Two Samples lattice::qqmath Q-Q Plot with Theoretical Distribution lattice::rfs Residual and Fit Spread Plots lattice::equal.count shingles lattice::splom Scatter Plot Matrices lattice::tmd Tukey Mean-Difference Plot lattice::trellis.object A Trellis Plot Object lattice::utilities.3d Utility functions for 3-D plots lattice::xyplot Common Bivariate Trellis Plots maanova::geneprofile Expression plot for selected genes maanova::gridcheck Plot grid-by-grid data comparison for arrays maanova::JS Internal maanova functions maanova::resiplot Residual plot for Microarray Experiment maanova::riplot Ratio intensity plot for 2-dye Microarray experiment maanova::varplot Variance component plot maanova::volcano Volcano plot for F test results MASS::eqscplot Plots with Geometrically Equal Scales MASS::hist.scott Plot a Histogram with Automatic Bin Width Selection MASS::ldahist Histograms or Density Plots of Multiple Groups MASS::lm.ridge Ridge Regression MASS::pairs.lda Produce Pairwise Scatterplots from an 'lda' Fit MASS::parcoord Parallel Coordinates Plot MASS::plot.lda Plot Method for Class 'lda' MASS::plot.mca Plot Method for Objects of Class 'mca' MASS::plot.profile Plottig Functions for 'profile' Objects MASS::truehist Plot a Histogram methods::setOldClass Register Old-Style (S3) Classes and Inheritance mgcv::plot.gam Default GAM plotting multtest::MTP-methods Methods for MTP and EBMTP objects in Package 'multtest' multtest::mt.plot Plotting results from multiple testing procedures nlme::Alfalfa Split-Plot Experiment on Varieties of Alfalfa nlme::Oats Split-plot Experiment on Varieties of Oats nlme::pairs.compareFits Pairs Plot of compareFits Object nlme::pairs.lmList Pairs Plot of an lmList Object nlme::pairs.lme Pairs Plot of an lme Object nlme::pdMat Positive-Definite Matrix nlme::plot.ACF Plot an ACF Object nlme::plot.Variogram Plot a Variogram Object nlme::plot.augPred Plot an augPred Object nlme::plot.compareFits Plot a compareFits Object nlme::plot.gls Plot a gls Object nlme::plot.intervals.lmList Plot lmList Confidence Intervals nlme::plot.lmList Plot an lmList Object nlme::plot.lme Plot an lme or nls object nlme::plot.nffGroupedData Plot an nffGroupedData Object nlme::plot.nfnGroupedData Plot an nfnGroupedData Object nlme::plot.nmGroupedData Plot an nmGroupedData Object nlme::plot.ranef.lmList Plot a ranef.lmList Object nlme::plot.ranef.lme Plot a ranef.lme Object nlme::qqnorm.gls Normal Plot of Residuals from a gls Object nlme::qqnorm.lm Normal Plot of Residuals or Random Effects from an lme Object nlme::simulate.lme Simulate results from lme models rpart::meanvar Mean-Variance Plot for an Rpart Object rpart::plot.rpart Plot an Rpart Object rpart::plotcp Plot a Complexity Parameter Table for an Rpart Fit rpart::post.rpart PostScript Presentation Plot of an Rpart Object rpart::rsq.rpart Plots the Approximate R-Square for the Different Splits spatial::trls.influence Regression diagnostics for trend surfaces stats::TukeyHSD Compute Tukey Honest Significant Differences stats::biplot Biplot of Multivariate Data stats::biplot.princomp Biplot for Principal Components stats::cpgram Plot Cumulative Periodogram stats::decompose Classical Seasonal Decomposition by Moving Averages stats::dendrogram General Tree Structures stats::ecdf Empirical Cumulative Distribution Function stats::hclust Hierarchical Clustering stats::interaction.plot Two-way Interaction Plot stats::kernel Smoothing Kernel Objects stats::lag.plot Time Series Lag Plots stats::lowess Scatter Plot Smoothing stats::monthplot Plot a Seasonal or other Subseries from a Time Series stats::plot.HoltWinters Plot function for HoltWinters objects stats::plot.acf Plot Autocovariance and Autocorrelation Functions stats::plot.density Plot Method for Kernel Density Estimation stats::plot.isoreg Plot Method for isoreg Objects stats::plot.lm Plot Diagnostics for an lm Object stats::plot.ppr Plot Ridge Functions for Projection Pursuit Regression Fit stats::plot.profile.nls Plot a profile.nls Object stats::plot.spec Plotting Spectral Densities stats::plot.stepfun Plot Step Functions stats::plot.ts Plotting Time-Series Objects stats::ppoints Ordinates for Probability Plotting stats::prcomp Principal Components Analysis stats::preplot Pre-computations for a Plotting Objeect stats::princomp Principal Components Analysis stats::qqnorm Quantile-Quantile Plots stats::runmed Running Medians -- Robust Scatter Plot Smoothing stats::scatter.smooth Scatter Plot with Smooth Curve Fitted by Loess stats::screeplot Screeplots stats::stats-defunct Defunct Functions in Package stats stats::plot.stl Methods for STL Objects stats::termplot Plot regression terms stats::ts.plot Plot Multiple Time Series stats::tsdiag Diagnostic Plots for Time-Series Fits stats4::plot-methods Methods for Function 'plot' in Package 'stats4' survival::lines.survfit Add Lines or Points to a Survival Plot survival::plot.aareg Plot an aareg object. survival::plot.cox.zph Graphical Test of Proportional Hazards survival::plot.survfit Plot Method for 'survfit' VGAM::biplot,rrvglm-method Biplot of Constrained Regression Models VGAM::deplot.lmscreg Density Plot for LMS Quantile Regression VGAM::guplot Gumbel Plot VGAM::lvplot Latent Variable Plot VGAM::lvplot.qrrvglm Latent Variable Plot for QO models VGAM::lvplot.rrvglm Latent Variable Plot for RR-VGLMs VGAM::meplot Mean Excess Plot VGAM::notdocumentedyet Undocumented and Internally Used Functions and Classes VGAM::persp.qrrvglm Perspective plot for QRR-VGLMs VGAM::plotdeplot.lmscreg Density Plot for LMS Quantile Regression VGAM::plotqrrvglm Model Diagnostic Plots for QRR-VGLMs VGAM::plotqtplot.lmscreg Quantile Plot for LMS Quantile Regression VGAM::plotvgam Default VGAM Plotting VGAM::plotvgam.control Control Function for plotvgam() VGAM::qtplot.gumbel Quantile Plot for Gumbel Regression VGAM::qtplot.lmscreg Quantile Plot for LMS Quantile Regression VGAM::rlplot.egev Return Level Plot for GEV Fits VGAM::trplot Trajectory Plot VGAM::trplot.qrrvglm Trajectory plot for QRR-VGLMs VGAM::AIC,vlm-method Undocumented Methods Functions waveslim::plot.dwt.2d Plot Two-dimensional Discrete Wavelet Transform waveslim::stackPlot Stack Plot wavethresh::plot.imwd Plot Method for an 'imwd' object wavethresh::plot.imwdc Plot Method for an 'imwdc' object wavethresh::plot.wd Plot Method for a 'wd' object car::av.plots Added-Variable Plots car::ceres.plots Ceres Plots car::cr.plots Component+Residual (Partial Residual) Plots car::influencePlot Regression Influence Plot car::leverage.plots Regression Leverage Plots car::panel.car Panel Function Coplots car::qq.plot Quantile-Comparison Plots car::reg.line Plot Regression Line car::scatterplot Scatterplots with Boxplots car::scatterplot.matrix Scatterplot Matrices car::spread.level.plot Spread-Level Plots car::subsets Plot Output from regsubsets Function in leaps package car::symbox Boxplots for transformations to symmetry multcomp::summary.glht Methods for General Linear Hypotheses pls::biplot.mvr Biplots of PLSR and PCR Models. pls::coefplot Plot Regression Coefficients of PLSR and PCR models pls::plot.mvr Plot Method for MVR objects pls::predplot Prediction Plots pls::scoreplot Plots of Scores, Loadings and Correlation Loadings pls::validationplot Validation Plots qvalue::qplot Graphical display of qvalue objects RUnit::includeTracker Internal functions zoo::plot.zoo Plotting zoo Objects zoo::xyplot.zoo Plot zoo Series with Lattice Type '?PKG::FOO' to inspect entry 'PKG::FOO TITLE'. > help("bannerplot") > help("bannerplot") > help("base-defunct") > help("base-defunct",htmlhelp=TRUE) Help for ‘base-defunct’ is shown in browser /usr/bin/xdg-open ... Use help("base-defunct", htmlhelp = FALSE) or options(htmlhelp = FALSE) to revert. Warning message: In .show_help_on_topic_as_HTML(file, topic) : Using non-linked HTML file: hyperlinks may be incorrect > help("base-defunct",htmlhelp=TRUE) Help for ‘base-defunct’ is shown in browser /usr/bin/xdg-open ... Use help("base-defunct", htmlhelp = FALSE) or options(htmlhelp = FALSE) to revert. Warning message: In .show_help_on_topic_as_HTML(file, topic) : Using non-linked HTML file: hyperlinks may be incorrect > ?help > x <- matrix(data=c(1,2,3,4,5,6), byrow=T, ncol=3) #Matrix with given rows > x [,1] [,2] [,3] [1,] 1 2 3 [2,] 4 5 6 > x[2,1] [1] 1 4 > x[2,1] [1] 4 > x[,1] [1] 1 4 > x [,1] [,2] [,3] [1,] 1 2 3 [2,] 4 5 6 > y <- cbind(x, c(21,22)) #Add a column > y [,1] [,2] [,3] [,4] [1,] 1 2 3 21 [2,] 4 5 6 22 > A <- rbind(c(2,1,1),c(1,2,1),c(1,1,2)) > A [,1] [,2] [,3] [1,] 2 1 1 [2,] 1 2 1 [3,] 1 1 2 > b <- c(1,2,3) > b [1] 1 2 3 > x <- solve(A, b) > x [1] -0.5 0.5 1.5 > x <- matrix(data=c(1,2,3,4,5,6), byrow=F, ncol=3) #Matrix with given rows > x [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 > lst <- list(c(1,2,3),"Jane") #Two unnamed entries > lst [[1]] [1] 1 2 3 [[2]] [1] "Jane" > lst[[1]] [1] 1 2 3 > lst[[2]] [1] "Jane" > lst <- list(a=c(1,2,3),b="Jane") #Two named entries > lst $a [1] 1 2 3 $b [1] "Jane" > lst$a [1] 1 2 3 > lst[[1]] [1] 1 2 3 >