From wdunlap at tibco.com  Mon Nov 28 21:31:33 2011
From: wdunlap at tibco.com (William Dunlap)
Date: Mon, 28 Nov 2011 20:31:33 +0000
Subject: [Rd] R CMD <custom>?
In-Reply-To: <CABdHhvGnCtK-D6QoiGUjBt0oygMZq_BTbqC_brqUAF7AnLu2tQ@mail.gmail.com>
References: <CAFDcVCSuR6159QO=0J8Xe9icY9AOLDnSUvMF=w7=r5+jaL=uZg@mail.gmail.com>
	<CABdHhvGnCtK-D6QoiGUjBt0oygMZq_BTbqC_brqUAF7AnLu2tQ@mail.gmail.com>
Message-ID: <E66794E69CFDE04D9A70842786030B93247BF0@PA-MBX03.na.tibco.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'.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

> -----Original Message-----
> From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf Of Hadley Wickham
> Sent: Monday, November 28, 2011 11:49 AM
> To: Henrik Bengtsson
> Cc: R-devel
> Subject: Re: [Rd] R CMD <custom>?
> 
> It'd be cool if R CMD was user extensible through packages, so that (e.g.)
> 
> R CMD mypackage::mycommand
> 
> would do something like:
> 
> path <- system.file("cmd", paste(command, ".r"), package = package)
> if (!file.exists(path)) {
>   stop("Command ", command, " in ", package, " does not exist")
> } else {
>   source(path)
> }
> 
> And maybe `R CMD mypackage` would look in mypackcage/cmd/default.r.
> 
> Hadley
> 
> On Mon, Nov 28, 2011 at 1:16 PM, Henrik Bengtsson <hb at biostat.ucsf.edu> wrote:
> > Hi,
> >
> > is it possible to add a custom script such that it is called via R CMD
> > <custom>? ?Is R CMD searching for it elsewhere than R_HOME/bin/? ?I'm
> > looking for an non-admin alternative, so copying the script to
> > R_HOME/bin/ will not do (in case the user don't have enough permission
> > to write there).
> >
> > /Henrik
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
> 
> 
> 
> --
> Assistant Professor / Dobelman Family Junior Chair
> Department of Statistics / Rice University
> http://had.co.nz/
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] R CMD <custom>?
William Dunlap