On Unix/Linux platforms, you can use the included Rscript utility by adding the following shebang at the top of your program. Command line arguments can then be retrieved using the commandArgs function:
#!/usr/bin/Rscript args <- commandArgs(trailingOnly = TRUE) args is now a character vector containing every space delimited text string that followed your program name when you ran it. trailingOnly is set to TRUE because the RScript interpreter prepends a few arguments of it's own that you will probably have no use for. As I stated earlier, this approach works great on Unix/Linux systems, I havn't tested it in a Windows environment. Good Luck! -Charlie ----- Charlie Sharpsteen Undergraduate Environmental Resources Engineering Humboldt State University -- View this message in context: http://www.nabble.com/Can-R-scripts-executed-in-batch-mode-take-a-commandline-argument--tp20000914p20005573.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.