How to fetch output when calling R using Qprocess or system

Posted by SYK on Stack Overflow See other posts from Stack Overflow or by SYK
Published on 2010-03-12T15:26:33Z Indexed on 2010/03/12 15:27 UTC
Read the original article Hit count: 313

Filed under:
|
|
|

Hi Experts,

I would like to execute a R script simply as

R --file=x.R

It runs well on the command line. However when I try the system call in C++ by

QProcess::execute("R --file=x.R");

or

system("R --file=x.R");

the program R runs and quits but I can't see the output the program is supposed to generate. If a program uses no stdout (such as R), how do I fetch the output after a system call either as a output file or in the program's own console?

Thanks for your time.

© Stack Overflow or respective owner

Related posts about c++

Related posts about qt