From hb at biostat.ucsf.edu  Mon Nov 28 21:41:48 2011
From: hb at biostat.ucsf.edu (Henrik Bengtsson)
Date: Mon, 28 Nov 2011 12:41:48 -0800
Subject: [Rd] R CMD <custom>?
In-Reply-To: <CABdHhvF7LkvmMVUw0V06pEYJb=_L-FHO=kj-FbijYcRFLp_6+g@mail.gmail.com>
References: <CAFDcVCSuR6159QO=0J8Xe9icY9AOLDnSUvMF=w7=r5+jaL=uZg@mail.gmail.com>
	<CABdHhvGnCtK-D6QoiGUjBt0oygMZq_BTbqC_brqUAF7AnLu2tQ@mail.gmail.com>
	<4ED3EC0F.4030407@gmail.com>
	<CABdHhvF7LkvmMVUw0V06pEYJb=_L-FHO=kj-FbijYcRFLp_6+g@mail.gmail.com>
Message-ID: <CAFDcVCQj3wTsF7rv2PuBOAgp2t9N8HiHE2XyeMGWi3ryZGy6mQ@mail.gmail.com>

On Mon, Nov 28, 2011 at 12:19 PM, Hadley Wickham <hadley at rice.edu> wrote:
>> That does seem to mix up namespaces quite a bit.
>
> That was just a proposal - equally
>
> R CMD mypackage::mycommand
>
> could just run
>
> mypackage::mycommand()
>
> but then passing argument might get a bit confusing.
>
>> But what does it get you
>> that "Rscript -e" doesn't already give you? ?You can set up your package so
>> that
>>
>> R CMD mypackage::mycommand
>>
>> executes a function, using delayedAssign or some of the more exotic features
>> (like external pointers and finalizers).
>
> Because you have to specify the path to that package? ?R CMD roxygen2
> is much easier to type, remember and is portable, compared to
> ~/R/roxygen2/something.r. ?It also makes R CMD scripts extensible by
> packages in a consistent manner.

When people run R CMD build, R CMD INSTALL, R CMD check etc, they are
in a well defined working directory.  It can be assumed that R CMD
roxygen2 will be executed in the same directory.  As so as you enter
the R prompt, you cannot assume this working directory, and you have
to document/specify which directory the command should be executed on.
 Because of this, I favor an 'R CMD roxygen2' solution.

My use case/wish is to be able to provide 'R CMD Rdoc' (similar to 'R
CMD roxygen2') and 'R CMD rsp' (similar to 'R CMD Sweave').

/Henrik

>
> Hadley
>
> --
> 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>?
Henrik Bengtsson