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(5124,4742,5434,5684,6332,6334,5636,5940,6195,6022,4535,4320,4872,4662,4663,5491,6018,6393,5610,5777,6094,6478,5216,5201,4784,4205,4681,4896,5752,6452,5995,5601,6119,6569,5798,5492,5018,4773,5502,5908,5902,6125,5419,5559,5962,6023,5346,5379,4859,5156,5010,5508,6426,6043,5499,5191,5790,5949,5219,4729) > par3 = '1e-08' > par2 = '80' > 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 2 digit(s) to the right of the | 42 | 12 44 | 4 46 | 6683478 48 | 670 50 | 12269 52 | 02258 54 | 23990016 56 | 0148589 58 | 001456 60 | 02224923 62 | 0339 64 | 3587 > > #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/1mp2y1324208896.tab") > > > > proc.time() user system elapsed 0.210 0.035 0.246