
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(257.102,62.156,662.883,251.422,171.328,350.089,221.588,4.813,183.186,190.379,223.166,232.669,356.725,109.215,475.834,315.955,694.87,8.95,278.741,308.16,207.533,192.797,601.162,289.714,293.671,386.688,699.645,85.094,131.812,645.285,197.549,308.174,86.58,242.205,238.502,187.881,140.321,440.31,421.403,218.761,1305.923,137.55,262.517,348.821,150.034,64.016,261.596,259.7,171.26,203.077,249.148,211.655,252.64,438.555,239.89,401.915,216.886,184.641,380.155,653.641,313.906,366.936,236.302,229.641,235.577,103.898,263.906,241.171,216.548,295.281,193.299,204.386,257.567,136.813,240.755,59.609,213.511,380.531,242.344,250.407,183.613,191.835,266.793,246.542,330.563,403.556,208.108,324.04,308.532,199.297,200.156,262.875,287.069,190.157,199.746,265.777,435.956,72.844,756.46,206.771,4202.361,401.422,216.046,39.047,441.437)
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)

#Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
load(file="/var/www/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('<pre>',RC.texteval('stem(x,par1,par2,par3)'),'</pre>',sep=''))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file="/var/www/rcomp/tmp/1dir51317543126.tab") 


