I like this plan and have now played with the concept. I did the following on Windows in cygwin. It would also work in Unix, and I think could be tickled to work on the standard MS cmd line in Windows. It would certainly work on Windows with a Windows-native port of the basic unix utilities. echo 'options(echo=FALSE);cat(pi^2,"\n")' | Rterm --no-save This produces an output file, that normally shows up in the *shell* buffer, but could be redirected. The obvious place to redirect it to is awk with a script to filter out everything above the echo of the options() line. The only change to R needed to remove the need for an awk script is to suppress the display of the copyright message and startup information. I suppose that could be done with a new --suppress-startup-info argument to Rterm. The other optimizations that Jeffrey and Dirk have, such as suppressing the loading of many of the standard packages, would also need to be done. Very good work and concept. Rich
New project: littler for GNU R
4 messages · Richard M. Heiberger, Gabor Grothendieck, Brian Ripley +1 more
The way it should work IMHO is that one can write any of these (in analogy to awk/perl/etc.): R -f myprog.R mydata.dat R -f myprog.R < mydata.dat cat mydata.dat | R -f myprog.R # or analogously on Windows R -e "...some.R.code... " mydata.dat R -e "...some.R.code... " < mydata.dat and there should be a simple way for myprog.R to read the input data that does not require that it know whether it was specified on the command line or redirected.
On 9/26/06, Richard M. Heiberger <rmh at temple.edu> wrote:
I like this plan and have now played with the concept. I did the following on Windows in cygwin. It would also work in Unix, and I think could be tickled to work on the standard MS cmd line in Windows. It would certainly work on Windows with a Windows-native port of the basic unix utilities. echo 'options(echo=FALSE);cat(pi^2,"\n")' | Rterm --no-save This produces an output file, that normally shows up in the *shell* buffer, but could be redirected. The obvious place to redirect it to is awk with a script to filter out everything above the echo of the options() line. The only change to R needed to remove the need for an awk script is to suppress the display of the copyright message and startup information. I suppose that could be done with a new --suppress-startup-info argument to Rterm. The other optimizations that Jeffrey and Dirk have, such as suppressing the loading of many of the standard packages, would also need to be done. Very good work and concept. Rich
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On Tue, 26 Sep 2006, Richard M. Heiberger wrote:
I like this plan and have now played with the concept. I did the following on Windows in cygwin. It would also work in Unix, and I think could be tickled to work on the standard MS cmd line in Windows. It would certainly work on Windows with a Windows-native port of the basic unix utilities. echo 'options(echo=FALSE);cat(pi^2,"\n")' | Rterm --no-save This produces an output file, that normally shows up in the *shell* buffer, but could be redirected. The obvious place to redirect it to is awk with a script to filter out everything above the echo of the options() line. The only change to R needed to remove the need for an awk script is to suppress the display of the copyright message and startup information. I suppose that could be done with a new --suppress-startup-info argument to Rterm.
It is called --slave.
The other optimizations that Jeffrey and Dirk have, such as suppressing the loading of many of the standard packages, would also need to be done.
Rterm --slave R_DEFAULT_PACKAHES=NULL and variables is already widely used in the R build process.
Very good work and concept. Rich
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On 9/26/06, Richard M. Heiberger <rmh at temple.edu> wrote:
I like this plan and have now played with the concept. I did the following on Windows in cygwin. It would also work in Unix, and I think could be tickled to work on the standard MS cmd line in Windows. It would certainly work on Windows with a Windows-native port of the basic unix utilities. echo 'options(echo=FALSE);cat(pi^2,"\n")' | Rterm --no-save This produces an output file, that normally shows up in the *shell* buffer, but could be redirected. The obvious place to redirect it to is awk with a script to filter out everything above the echo of the options() line.
It seems to me that a big difference between this and littler is how stdin is treated. How would you implement the fsizer.r example using this concept?
The only change to R needed to remove the need for an awk script is to suppress the display of the copyright message and startup information. I suppose that could be done with a new --suppress-startup-info argument to Rterm.
I typically use --vanilla --slave (which I assume would work on Windows too).
The other optimizations that Jeffrey and Dirk have, such as suppressing the loading of many of the standard packages, would also need to be done. Very good work and concept. Rich