From hadley at rice.edu  Mon Nov 28 21:19:43 2011
From: hadley at rice.edu (Hadley Wickham)
Date: Mon, 28 Nov 2011 14:19:43 -0600
Subject: [Rd] R CMD <custom>?
In-Reply-To: <4ED3EC0F.4030407@gmail.com>
References: <CAFDcVCSuR6159QO=0J8Xe9icY9AOLDnSUvMF=w7=r5+jaL=uZg@mail.gmail.com>
	<CABdHhvGnCtK-D6QoiGUjBt0oygMZq_BTbqC_brqUAF7AnLu2tQ@mail.gmail.com>
	<4ED3EC0F.4030407@gmail.com>
Message-ID: <CABdHhvF7LkvmMVUw0V06pEYJb=_L-FHO=kj-FbijYcRFLp_6+g@mail.gmail.com>

> 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.

Hadley

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



[Rd] R CMD <custom>?
Hadley Wickham