R version 3.4.0 (2017-04-21) -- "You Stupid Darkness" Copyright (C) 2017 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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) + } > y <- c(4 4 3 4,5 4 4 4,4 4 3 5,5 5 4 4,3 4 3 4,5 5 4 4,4 4 3 3,3 5 4 4,4 4 4 4,4 5 5 4,5 4 4 4,4 5 5 4,3 5 4 4,4 5 5 3,5 3 4 4,4 5 3 5,3 4 4 5,4 4 4 5,3 3 5 4,4 5 4 5,3 4 5 4,4 4 4 4,3 4 5 5,4 3 4 5,4 3 4 4,4 4 4 4,3 3 3 3,5 4 4 5,4 3 3 4,4 4 4 4,4 3 3 4,4 4 4 4,4 5 4 3,4 4 3 4,5 3 3 3,5 4 5 4,4 3 4 3,4 4 4 4,4 3 4 3,4 4 3 4,3 3 4 5,4 2 4 4,3 3 3 3,4 2 5 4,3 3 4 3,4 3 4 4,3 4 4 3,4 2 4 4,5 3 3 3,5 4 4 2,3 3 3 3,5 4 4 2,5 3 3 3,5 4 4 3,5 3 3 4,5 4 4 2,3 5 5 3,4 5 5 4,4 3 3 3,4 5 5 4,4 5 5 3,4 5 5 4,3 5 5 3,4 5 5 4,4 3 3 5,4 4 4 5,3 4 4 3,5 4 4 5,4 4 4 5,4 4 4 5,4 3 3 5,4 4 4 5,4 3 4 3,3 4 4 4,4 2 3 4,5 3 5 4,5 4 4 4,3 3 4 4,5 4 4 3,5 3 4 4,5 4 4 3,5 3 3 4,4 3 3 5,4 4 4 5,3 4 4 3,5 4 4 5,4 4 4 5,4 4 4 5,4 3 3 5,4 4 4 5,4 3 4 3,3 4 4 4,4 2 3 4,5 3 5 4,5 4 4 4,3 3 4 4,5 4 4 3,5 3 4 4,5 4 4 3,5 3 3 4) Error: unexpected numeric constant in "y <- c(4 4" Execution halted