You can try:

system("command", show.output.on.console=TRUE)



On 24/01/07, Darren Obbard <darren.obbard@ed.ac.uk> wrote:
>
> Hi,
>
> Any help on the following would be much appreciated
>
> I wish to capture the output (currently going to console) from an
> external executable.
>
> The executable is successfully run using
>
>      system("program -switch ")
>
> and the output printed to the DOS console.
>
> How do I capture this output? I have tried redirecting the output to a
> text file, and then reading this in
>
>      system("program -switch > textfile.txt")
>      data<-scan("textfile.txt")
>
> But this does not seem to work (the textfile.txt is not written). It
> does however work if I invoke the console to be permanent
>
>      system("cmd /K program -switch > textfile.txt")
>      data<-scan("textfile.txt")
>
> Unfortunately, this leaves me with an open console window I have to
> close manually.
>
> Is there a way of doing this (under windows) using system( ) or some
> other command? It appears that pipe( ) may do it, but I cannot
> understand the documentation.
>
> An example of the appropriate syntax would be an enormous help.
>
> Thanks in advance,
>
> Darren
>
> Darren.Obbard@ed.ac.uk
>
> --
>
> Darren Obbard
> Institute of Evolutionary Biology
> Ashworth Labs
> Kings Buildings
> University of Edinburgh, UK
>
> ______________________________________________
> R-help@stat.math.ethz.ch 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.
>



-- 
Henrique Dallazuanna

	[[alternative HTML version deleted]]

