[R] shelling out to R for one command

Paul Meagher paul at email4all.ca
Sun Nov 17 04:34:50 CET 2002


>> Is there a way to pass R a one-liner without having to put it into a
>> batch file and submit it to R as a batch job.

David Firth wrote

>
> various possibilities for this using unix redirection
> e.g.
>
> david% echo "3+4" | R --slave
> [1] 7

This works nicely:

echo "q(.975, 20)" | R --slave

> One could for example set this up as a shell script "Roneliner",
> so that
>
> david% Roneliner "3+4"
> [1] 7

Or this:

paul% R1 "3+4"
[1] 7

BTW, what do you think Roneliner would look like as a shell script?

> Possibly it's more economical also to use arguments
>      --no-restore --no-save --no-readline --gui=none
> in addition to --slave.

The most economical startup options would be good to know.

My guess would be just  --vanilla option?

Regards,
Paul


> David
>
>
>> Regards,
>> Paul Meagher
>>
>>
>>
>>
>> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>> .-.-.-.-.-
>> r-help mailing list -- Read
>> http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
>> Send "info", "help", or "[un]subscribe"
>> (in the "body", not the subject !)  To:
>> r-help-request at stat.math.ethz.ch
>> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>  ._._._._


-- 
50 Wood Grove Drive
Truro, Nova Scotia
B2N-6Y4
1.902.895.9671
www.datavore.com


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list