[R] Passing object value in command line

MacQueen, Don macqueen1 at llnl.gov
Thu Oct 16 00:34:16 CEST 2014


Don¹t know exactly what you mean by ³passing the value of Mon from the
command prompt², but it could be

At the R prompt:

> Mon <- ¹31-may-2014¹
> source(mainCall.R)

If, on the other hand, you mean shell prompt, then within R see
  ?commandArgs

On 10/15/14, 11:21 AM, "Abhinaba Roy" <abhinabaroy09 at gmail.com> wrote:

>Hi R-helpers,
>
>I have a R script (mainCall.R) which takes the value of an object *'Mon'*
>as '31-may-2014' or '31-aug-2014' .
>
>How can I run the R script by passing the value of Mon from the command
>prompt?
>
>Any help will be appreciated
>
>Regards,
>Abhinaba
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at 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.



More information about the R-help mailing list