R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(3575,1511,2151,2799,2024,1748,2022,3142,900,1723,1904,1681,3634,2329,1547,2787,2608,1836,4000,2211,2223,3633,1655,2911,2192,2301,1805,2813,1100,2571,2773,2120,3130,3134,1693,1855,2323,1848,5300,2674,3417,1747,1810,2555,2800,1618,3490,3512,700,1955,1717,2216,2386,1642,2170,2270,2220,3064,6480,2756,1705,1834,2220,2069,2985,2645,2658,3595,100,3213,2690,3160,1761,3246,2625,2430,2876,2451,4920,2989,2013,2979,2732,3517,1899,3596,3219,1994,1330,2226,2837,3092,2610,2293,1715,3439,2258,3183,999,2662,2899,2946,3022,3627,2659) > par3 = '500' > par2 = '500' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2011, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > stem(x,par1,par2,par3) The decimal point is 3 digit(s) to the right of the | 0 | 1 0 | 79 1 | 013 1 | 5566777777777888888999 2 | 000001122222222233333344 2 | 566666677777788888889999 3 | 0000111112222244 3 | 555666666 4 | 0 4 | 9 5 | 3 5 | 6 | 6 | 5 > > #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/168ue1323263179.tab") > > > > proc.time() user system elapsed 0.215 0.030 0.233