[R] calling a C program from R

Duncan Murdoch murdoch at stats.uwo.ca
Mon May 5 01:47:00 CEST 2008


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



More information about the R-help mailing list