[R] command option for R CMD BATCH
Prof Brian Ripley
ripley at stats.ox.ac.uk
Thu Nov 23 16:32:12 CET 2006
On Thu, 23 Nov 2006, Ramon Diaz-Uriarte wrote:
> On Thursday 23 November 2006 15:44, Prof Brian Ripley wrote:
>> Try this:
>>
>> gannet% cat month.R
>> x <- commandArgs()
>> print(x[length(x)])
>>
>> gannet% R --slave --args January < month.R
>> [1] "January"
>
> Is the above
> "R --slave --args January < month.R"
> the preferred way of using it?
Yes it is. That's exactly what --args was added to allow.
> I tend to use
>
> "R --slave < month.R January"
>
> instead (as a consequence of reconverting former scripts that used R CMD
> BATCH). The second call produces a "ARGUMENT 'January' __ignored__" but
> otherwise seems to do the same thing.
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list