[R] reading data from stdin

Maciej.Hoffman-Wecker@evotecoai.com Maciej.Hoffman-Wecker at evotecoai.com
Wed Nov 21 14:08:02 CET 2001


Hello s/r users!

I've been digging around in the s- and r-mailing lists, 
but i actually didn't find any answer to my question. 
So here it is:

How can i realize the following:

        myexec  |  R r_script >  outfile.txt

with 
        myexec          some executable writing data to stdout
                        "cat data.txt" can serve as a test
        R               is supposed to be "Rcmd BATCH" or "S BATCH" in 
case of S+6
        r_script        a script including a 
read_data_form_stdin_statement
                        something like: scan(stdin()) 

In this case myexec and R use the standard pipes. 
Are there any other possibilities? something like named pipes?
So that R could be invoked with a parameter containing the name of the 
pipe, 
to be used for reading data?

I've been playing around with connections, but i can't imagine how i could 

solve the problem.

I hope someone has any suggestions. 

Additionally, if there are any differences in that case, 
between R and S+6 on unix (linux) as well on windows, 
please give me a hint.

sincerely,

maciej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20011121/980392eb/attachment.html


More information about the R-help mailing list