[R] DCom / StatConnector / Windows-Cygnus-Gcc ?

Michael Camann mac24 at humboldt.edu
Thu Oct 5 18:34:45 CEST 2000


Oliver--

I used to do this sort of thing extensively wirh S-plus on a unix box, but
perhaps the same strategy will work under R-windows as well.  The key was
to write the simulation program as an independent, standalone routine that
read its input parameters from a text file and output its results to
another file.  Then, it was easy to write an S-plus wrapper program that
used system calls to write the desired parameters to the input file, run
the model as a spawned process, and then suck in the model output file for
display, analyses, etc.  It isn't strictly necessary to use the wrapper
function as both a front end and back end, but that's handy because it
allows you to write a function that will re-run the simulation routine
with parameters modified according to the analyses of the output from
previous runs.  This allows the routine to automatically do things like
brute force optimization of the input parameters, explore interesting
regions of the parameter space, etc.  I spent a fair amount of my later
grad school years enjoying myself in the local beer hall while my S-plus
wrapper chugged away on thousands of simulation runs in my absence....

I assume there is some equivalent way to invoke a shell and execute a
command in R-win(?).  Sorry, I can't check at present because I'm not
using a windows box.  If this approach won't work for R-win you might want
to install linux! 

Oh-- one other thing-- I think this is easier than passing control to your
simulation via .C calls because it allows the simulation to manage all of
its own variables and memory use.  Since the compiled code is typically
far faster than R, and since the output can be read in at the end of the
simulation run, there is no need for complicated memory structures in most
simulations-- the current model state can simply be appended to the output
file after each time step.

--Mike C.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Michael A. Camann                                  Voice: 707-826-3676
Assistant Professor of Zoology                       Fax: 707-826-3201
Institute for Forest Canopy Research     Email: mac24 at axe.humboldt.edu
Department of Biology                            ifcr at axe.humboldt.edu
Humboldt State University           
Arcata, CA 95521

                 URL:http://www.humboldt.edu/~mac24/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list