Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
3 views
in R Programming by (10.2k points)
edited by
I want to supply some command-line parameters from a R script I have. And it runs on windows.

I just want it read the command line parameters from a R script, Can someone help me with it?

1 Answer

0 votes
by (50.2k points)

I want to say some points on that:

  1. Command-line parameters are obtainable via commandArgs(), so for understanding that in detail, write help(commandArgs).
  2. You can use Rscript.exe on all operating systems, including Windows. It will support commandArgs(). 
  3. There are two add-on packages on CRAN -- getopt and optparse -- which were both written for command-line parsing.

If you want to know more about R then do check out the R programming course.

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...