[R] R as a `script'
B.Rowlingson at lancaster.ac.uk
Wed Feb 5 18:28:03 CET 2003
Thomas Lumley wrote:
> or more elegantly in a single file as
> echo "library(tools);Sweave('"$1"')" | /usr/local/bin/R --vanilla --silent
What's more elegant than a 'here' document?
R --slave --vanilla "$@" <<EOF
x <- runif(1000)
- save to a file, make executable, run. It even handles command line
arguments (the "$@" bit) which can be picked up by commandArgs().
More information about the R-help