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]]
There is this great document called the R Reference that comes with the software in which you can search for "command" and find the answer. There is also a useful function called apropos that can search the help files from the R prompt. Try apropos("command"). There is also a manual for this mailing list (the Posting Guide mentioned in the footer of this message) that points out that HTML email is stripped when sent to this list, so what you see is not what we see unless you send in plain text. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On October 15, 2014 11:21:49 AM PDT, 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.
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.