#!/bin/sh
echo 'a="${1}"; b="${2}"; source("myRcodeUsing_a_and_b.R"); ' | R 
--vanilla --quiet

and you can run this from shell like:

./callR valueOfa valueOfb

Best, Oleg

akintayo holder wrote:
> Hi,
>  Does any one know if it is possible to create an R script that can use
> command line parameters. I can execute an R script from the command line,
> but I  cannot figure out how to pass parameters to the script. The only
> resources I have found seem somewhat involved or incomplete.
> 
> Any help is appreciated.
> Akintayo
> 
>       [[alternative HTML version deleted]]
> 
> ______________________________________________
> [email protected] 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.

-- 
Dr Oleg Sklyar | EBI-EMBL, Cambridge CB10 1SD, UK | +44-1223-494466

______________________________________________
[email protected] 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.

Reply via email to