Thomas Lumley wrote:

or more elegantly in a single file as
#!/bin/sh
echo "library(tools);Sweave('"$1"')" | /usr/local/bin/R --vanilla --silent

What's more elegant than a 'here' document?

#!/bin/sh
R --slave --vanilla "$@" <<EOF

print(commandArgs())
x <- runif(1000)
print(mean(x))

EOF

- save to a file, make executable, run. It even handles command line arguments (the "$@" bit) which can be picked up by commandArgs().


Baz

______________________________________________
[EMAIL PROTECTED] mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to