From hadley at rice.edu  Mon Nov 28 21:38:46 2011
From: hadley at rice.edu (Hadley Wickham)
Date: Mon, 28 Nov 2011 14:38:46 -0600
Subject: [Rd] R CMD <custom>?
In-Reply-To: <E66794E69CFDE04D9A70842786030B93247BF0@PA-MBX03.na.tibco.com>
References: <CAFDcVCSuR6159QO=0J8Xe9icY9AOLDnSUvMF=w7=r5+jaL=uZg@mail.gmail.com>
	<CABdHhvGnCtK-D6QoiGUjBt0oygMZq_BTbqC_brqUAF7AnLu2tQ@mail.gmail.com>
	<E66794E69CFDE04D9A70842786030B93247BF0@PA-MBX03.na.tibco.com>
Message-ID: <CABdHhvHpjzKn==7aDrcGe8SHBbB6MHmPJe8edaCxWVWLd5CA2Q@mail.gmail.com>

> The shell command
> ?R CMD something
> currently acts as though it puts R_HOME/bin on the front
> of PATH, looks for an executable file called 'something'
> in PATH, and then executes it. ?The executable may call R
> or it may not.
>
> I think that running an R script file is sufficiently different
> from running an executable file that the operation should
> not also be called 'CMD'.

Fair enough. But it would still be extremely useful to have an R
"command" which did run R scripts (which naively you would expect R
CMD to do do).  Maybe R SCRIPT ?

Or R CMD package::script could look for an arbitrary script and
execute it - I suspect this would be trickier cross-platform though.

One could also consider eliminating R CMD and the bin directory, given
that most of the scripts there now just call an R function.  Perhaps a
general syntax for calling R scripts in an package could subsume these
important scripts in a consistent and package-extensible manner.

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



[Rd] R CMD <custom>?
Hadley Wickham