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(59,34,49,50,34,15,107,9,28,41,46,66,48,37,72,50,90,64,66,38,56,60,96,43,37,49,48,63,62,35,62,59,47,72,24,82,28,60,90,2,47,30,27,74,75,41,49,42,31,32,101,22,51,77,42,47,7,91,18,28,61,68,95,29,65,71,57,87,66,49,58,55,48,40,52,52,33,51,20,54,47,40,77,68,51,38,42,33,96,40,54,22,34,36,31,80,67,41,57,51,39,61,68,45,51,64,74,24,86,63,65,40,12,43,46,56,65,61,28,26,37,17,35,28,62,23,28,28,68,6,12,42,17,28,37,88,6,58,6,9,13,37,25,68,51,22,36,27,11,42,76,48,30,91,70,98,44,27,24,64,98,23,33,90,36,57,46,39,32,69,83,54,48,71,29,38,55,26,62,38,21,23,4,50,76,2,13,5,37,26,42,27,22,16,39,33,20,18,28,20,21,14,38,30,25,12,22,50,37,34,26,34,15,23,16,15,17,16,18,22,21,29,27,19,9,38,20,18,17,21,9,23,24,14,18,16,44,13,20,11,26,39,14,14,20,24,28,24,24,10,42,28,5,28,24,9,9,25,17,11,8,21,10,15,14,23,18,16,33,21,29,20,12,29,17,19,15,5,24,23,22,25,25,11,18,14,16,17,20) > par3 = '1e-08' > par2 = '80' > par1 = '1' > par3 <- '1e-08' > par2 <- '80' > par1 <- '1' > #'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 1 digit(s) to the right of the | 0 | 22455566678999999 1 | 0011112222333444444555556666667777777888888899 2 | 00000000111111222222233333334444444445555566666777778888888888889999 3 | 000112233333444445566677777778888889999 4 | 00001112222222334456667777888889999 5 | 00001111112244455667778899 6 | 001112222334445556667888889 7 | 011224456677 8 | 023678 9 | 0001156688 10 | 17 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/1u6tn1355691873.tab") > > > > proc.time() user system elapsed 0.265 0.073 0.312