Skip to content

Giving parameters from shell

4 messages · cihan inan, Paul Hiemstra, Don MacQueen

#
cihan inan wrote:
Hi,

Add the following shebang line at the top of your script:

#! /path/to/Rscript

The following lines will get you the parameters passed on by the user:

args = commandArgs(TRUE)

cheers,
Paul
#
Try for yourself and see. (it's not difficult to try)

For example, put the line in both places, followed by
   print(args)
and see what happens.

-Don
At 11:49 PM +0200 1/14/10, cihan inan wrote: