Re: [R] calling a C program from R

From: Duncan Murdoch <>
Date: Sun, 04 May 2008 19:47:00 -0400

On 04/05/2008 7:39 PM, Paulo Cardoso wrote:
> Is it possible to call a program (an .exe wrote in C) from R Gui? I'm
> interested in interact with inputs for this program and analyze outputs with
> R.
> The program itself calls a input.dat file with a number of needed
> parameters. Based on this input file it produces a number of files resuming
> the parameterized analysis. I'm actually already able to read these outputs
> with R, and produce a number of outputs (graphs and tables). Nevertheless,
> each run of the program is manually done by now. It would be interesting to
> loop the call of the program, manipulating parameters at each run.
> Do exist a way of interact with a external exe from R?

There are several. You probably want to use system() or shell().

Duncan Murdoch mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Sun 04 May 2008 - 23:49:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 05 May 2008 - 02:30:37 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive