From MEC at stowers.org  Tue Sep 20 00:35:15 2011
From: MEC at stowers.org (Cook, Malcolm)
Date: Mon, 19 Sep 2011 17:35:15 -0500
Subject: [Rd] using R as SHELL in gnu make
Message-ID: <2C40E43D1F7A56408C4463FD245DDDF9856C3218@EXCHMB-02.stowers-institute.org>

I am intrigued by the possibility of using R as the SHELL in a (Gnu) makefile (instead of /bin/sh).  (c.f. http://www.gnu.org/software/make/manual/make.html#Choosing-the-Shell)

Well, rather, I would like the makefile's SHELL to be a command which communicated with an R process.

The makefile targets/prerequistes would, as always, be OS files, which would be written/read using standard R file IO.

The makefile's "recipe"s would be written in R (instead of the usual shell).

The R process would be able to be initiated by `load`ing one or more R datasets, libraries or entire images.

The R process would be able to accumulate state as the makefile progressed.  The recipe's would be able to refer to that state, allowing conditional execution.

The R process would optionally be saved as an image of on job termination/completion.

The R process might be managed using the RServe package, and would need to be initiated once only, when the makefile was first invoked.

I would appreciate learning if anyone had any success, informative failures, or other lore that may help in (or dissuade me from) embarking on attempt this.

Thanks,

Malcolm Cook
Stowers Institute for Medical Research



[Rd] using R as SHELL in gnu make
Cook, Malcolm