problem with command line arguments

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with command line arguments

madhurima bhattacharjee
Hello Everybody,

I am running a R script through a perl code from command line.
The perl script is like:

my $cmd= 'R CMD BATCH D:/try5.R';
system($cmd);

I run the perl code from command line.
Now I want to pass some command line arguments to the R script.
Its like the argv concept of perl.

Do I pass the arguments through my $cmd in the perl script?
If yes, then how to access that in the R script?
Any help will really be appreciated.

Thanks and Regards,
Madhurima.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: problem with command line arguments

Uwe Ligges
madhurima bhattacharjee wrote:

> Hello Everybody,
>
> I am running a R script through a perl code from command line.
> The perl script is like:
>
> my $cmd= 'R CMD BATCH D:/try5.R';
> system($cmd);
>
> I run the perl code from command line.
> Now I want to pass some command line arguments to the R script.
> Its like the argv concept of perl.
>
> Do I pass the arguments through my $cmd in the perl script?
> If yes, then how to access that in the R script?
> Any help will really be appreciated.


See ?commandArgs

Uwe Ligges


> Thanks and Regards,
> Madhurima.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html