[R] open/execute/call/run an external file

STEPHEN M POWERS smpowers at wisc.edu
Wed Aug 22 05:47:34 CEST 2007


I'm trying to figure out how to trigger a process from within R. I have an exectuable file that runs a Fortran model, but ideally, would like to run it from R. Note that I'm not talking about importing the function at all, passing variables, or anything complicated like that. I basically just want a script that "double-clicks" on a particular file and opens/runs it for me.

The idea here is that the executable Fortran file, when double clicked, simply draws all necessary inputs from text files within the same directory and I have no need to change this. So I've used R to summarize some raw data and format these required text input files in the way the Fortran executable requires, and also have scripts to interpret the Fortran text file outputs and summarize/plot them in R. The problem is I must run the first part of the R script to send data from R to the model, then double click the Fortran executable, then run the second part of the R script to get the model outputs into R, in three separate steps. Given that I may be doing this hundereds of times, I'd prefer to do it all in one step.

Any thoughts?---steve



More information about the R-help mailing list