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(56,56,54,89,40,25,92,18,63,44,33,84,88,55,60,66,154,53,119,41,61,58,75,33,40,92,100,112,73,40,45,60,62,75,31,77,34,46,99,17,66,30,76,146,67,56,107,58,34,61,119,42,66,89,44,66,24,259,17,64,41,68,168,43,132,105,71,112,94,82,70,57,53,103,121,62,52,52,32,62,45,46,63,75,88,46,53,37,90,63,78,25,45,46,41,144,82,91,71,63,53,62,63,32,39,62,117,34,92,93,54,144,14,61,109,38,73,75,50,61,55,77,75,72,50,32,53,42,71,10,35,65,25,66,41,86,16,42,19,19,45,65,35,95,49,37,64,38,34,32,65,52,62,65,83,95,29,18,33,247,139,29,118,110,67,42,65,94,64,81,95,67,63,83,45,30,70,32,83,31,67,66,10,70,103,5,20,5,36,34,48,40,43,31,42,46,33,18,55,35,59,19,66,60,36,25,47,54,53,40,40,39,14,45,36,28,44,30,22,17,31,55,54,21,14,81,35,43,46,30,23,38,54,20,53,45,39,20,24,31,35,151,52,30,31,29,57,40,44,25,77,35,11,63,44,19,13,42,38,29,20,27,20,19,37,26,42,49,30,49,67,28,19,49,27,30,22,12,31,20,20,39,29,16,27,21,19,35,14) > 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 | 55001234444667778889999999 2 | 00000001122344555556777889999900000001111111222223333444445555555666 4 | 00000001111222222233344444555555566666678999900222233333334444455556 6 | 000111122222233333334445555566666667777780001112335555567778 8 | 1122333468899012223445559 10 | 0335790227899 12 | 129 14 | 44614 16 | 8 18 | 20 | 22 | 24 | 79 > > #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/13o9t1355851549.tab") > > > > proc.time() user system elapsed 0.291 0.090 0.360