R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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. 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. > > RC.capture <- function (expression, collapse = NULL) { + resultConn <- textConnection('RC.resultText', open = 'w', local=TRUE) + sink(resultConn) + on.exit(function() { + sink() + close(resultConn) + }) + expression + on.exit(NULL) + sink() + close(resultConn) + return(paste(c(RC.resultText, ''), collapse = collapse, sep = '')) + } > RC.texteval <- function (sourceText, collapse = NULL, echo = TRUE) { + sourceConn <- textConnection(sourceText, open = 'r') + on.exit(close(sourceConn)) + result <- RC.capture(source(file = sourceConn, local = FALSE, echo = echo, print.eval = TRUE), collapse = collapse) + on.exit(NULL) + close(sourceConn) + res <- '' + for(i in 1:length(result)) { + if (result[i]!='') res <- paste(res,result[i],' + ',sep='') + } + return(res) + } > x <- c(16.3,17.4,8.6,13.8,12.0,13.8,16.0,13.5,6.0,14.6,13.1,18.2,16.9,17.9,14.0,27.9,15.5,7.3,18.1,16.0,18.8,15.6,12.2,19.2,17.6,18.0,17.0,17.0,18.2,19.4,15.4,14.9,11.3,15.7,15.0,15.2,12.5,12.0,12.9,25.0,13.1,10.8,13.8,16.8,14.3,10.1,16.6,18.4,18.1,12.0,27.5,15.7,19.4,15.7,29.5,15.8,23.8,21.0,25.4,12.1,17.8,11.5,15.4,11.0,11.1,10.5,13.9,13.1,19.0,11.4,15.8,15.3,20.4,10.3,12.6,16.4,15.2,19.7,12.9,16.3,8.0,11.0,9.7,19.0,20.8,18.6,14.2,19.7,4.5,14.9,17.3,19.2,14.6,15.1,13.1,15.5,17.6) > par3 = '1e-08' > par2 = '80' > par1 = '5' > par3 <- '1e-08' > par2 <- '80' > par1 <- '5' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Stem-and-leaf Plot (v1.0.5) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_stem.wasp/ > #Source of accompanying publication: > # > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > stem(x,par1,par2,par3) The decimal point is at the | 4 | 5 5 | 6 | 0 7 | 3 8 | 06 9 | 7 10 | 1358 11 | 001345 12 | 000125699 13 | 111158889 14 | 0236699 15 | 012234455677788 16 | 00334689 17 | 00346689 18 | 01122468 19 | 00224477 20 | 48 21 | 0 22 | 23 | 8 24 | 25 | 04 26 | 27 | 59 28 | 29 | 5 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Stem-and-leaf Plot',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,paste('
',RC.texteval('stem(x,par1,par2,par3)'),'
',sep='')) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/1ffvc1355768188.tab") > > > > proc.time() user system elapsed 0.266 0.080 0.328