Index of /examples/r/examples/input_args

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[TXT]args.R 2014-02-19 19:54 530  
[TXT]r_job 2021-03-19 00:06 324  
[   ]rscript_job 2021-03-19 00:07 109  

Passing arguments to R script from a command line

args.R script processes the command line and, if arguments are given, assigns the values to the appropriate variables

Interactive execution:

You can execute the code interactively:
scc1% R -q --slave --vanilla --args 10000 21.7 2.2 < args.R

The first 3 options are optional:
  • -q option runs R in a "quiet" mode - startup message is not printed
  • --slave option make R run as quiet as possible - does not print the R script
  • --vanilla option tells R not to search for user-defined enviroment variables

  • The alternative way to run the code interactively:
    scc1% Rscript args.R 10000 21.7 2.2

    Submit R job:

    This directory contains 2 script files - r_job and rscript_job, which submit the job using R and Rscript commands respectevely and pass arguments to the R script.
    scc1% qsub r_job
    scc1% qsub rscript_job

    Contact Information: