[R] writing R shell scripts?

From: Deepak Chandra <dchandra_at_ics.uci.edu>
Date: Wed 24 Jan 2007 - 03:31:27 GMT


Hi All,

Another newbie question. I want to write an R script that takes argument from command line and runs and produces output to stdin.

For example if there is file foo.R with following in it.

args = commandArgs()
print(args)

then, when I run it like
 $ R foo.R hello
it should print 'hello' on the terminal.

I searched the mainling list and found a very old post that said said that this feature will be implemented soon. I am expecting this has already been implemented by now.

Thanks,
Deepak



R-help@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. Received on Wed Jan 24 14:55:31 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 24 Jan 2007 - 06:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.