Skip to content

Mods that allow R scripts

2 messages · Neil McKay MD, David Brahm

#
I've hacked R so that it can be used to write shell and/or
CGI scripts, e.g. "hello world" can be written as:


	#!/usr/local/lib/R/bin/R.bin --script

	cat("Hello, World!\n");

The mods required to enable this aren't particularly major.
(Adds about 70 lines of code, IIRC.) Anyone else interested
in adding this to the R core?
#
Neil McKay MD writes:
That is very cool, and would replace about 25 lines of Perl wrapper for me, IF
you could also easily pass flags and arguments, e.g.:
  Unix> myRscript -e -f datafile
These would have to become R variables, somehow.