From ligges at statistik.uni-dortmund.de  Mon Jul 12 16:27:47 2004
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Mon Jul 12 16:27:58 2004
Subject: [Rd] Re: [R] Creating a minimal package
In-Reply-To: <ta45f0ljhetd4ai746fs18dff7mim7o1i0@4ax.com>
References: <OAEOKPIGCLDDHAEMCAKICEHJCPAA.sdhyok@email.unc.edu>	<40F0B07E.5060105@jhsph.edu>	<loom.20040711T073351-641@post.gmane.org>	<ngc2f0h8up0ip07bshguimh85644ltme39@4ax.com>	<loom.20040711T231128-574@post.gmane.org>	<ebr3f098aho62muqapebiplkh1n3prf7et@4ax.com>	<loom.20040712T055834-547@post.gmane.org>	<40F23322.6010809@statistik.uni-dortmund.de>
	<loom.20040712T131806-594@post.gmane.org>
	<40F28EB3.7060902@statistik.uni-dortmund.de>
	<ta45f0ljhetd4ai746fs18dff7mim7o1i0@4ax.com>
Message-ID: <40F29FE3.40906@statistik.uni-dortmund.de>

Duncan Murdoch wrote:

> On Mon, 12 Jul 2004 15:14:27 +0200, Uwe Ligges
> <ligges@statistik.uni-dortmund.de> wrote :
> 
> 
>>Gabor Grothendieck wrote:
> 
> 
>>>The objective should be that creating a package is as easy as this:
>>>
>>>   f <- function()1; g <- function()2; d <- 3; e <- 4:5
>>>   package.skeleton(list=c("f","g","d","e"), name="AnExample")
>>>   library(AnExample)
>>>   f()
>>>   
>>>which means that the package needs to be inserted where library will
>>>find it. It should not be necessary to have an understanding of this.
>>>
>>
>>OK, I understand what you are going to do, but in that case you can use 
>>dump() into an *.R or save() into an *.RData file and use 
>>source()/load() to load it again. I don't see any advantage of a package 
>>if you don't want to modify documentation or other stuff in the package.
>>Also, you would need the tools to make a binary package from the source 
>>package somewhere. package.skeleton() is clearly not intended to be used 
>>for that purpose, but to create the template for your source package.
>>Hence the default should not be changed.
> 
> 
> I agree with both of you on this.  Currently the method that Uwe
> describes is a lot easier than creating a package, but I think the
> objective should be to make things almost as easy as Gabor describes.
> 
> Not completely as easy:  he's missing the step where the package is
> installed.  I think we want to keep that (because the distinction
> between the source of a package and the installed copy of it is
> important), but it should be easier to install a new package than it
> is now, especially in Windows.  So I'm suggesting that it would be
> nice to be able to do something like this:
> 
>  f <- function()1; g <- function()2; d <- 3; e <- 4:5
>  package.skeleton(list=c("f","g","d","e"), name="AnExample")
>  install.packages("AnExample", build = TRUE)
>  library(AnExample)
>  f()

[moved the thread to R-devel....]

Yes. That's the ideal solution.

Anyway, these days you still need perl, and what happens if you have got 
some C or Fortran sources?
Additionally, we can never do all the stuff without the tools. And I 
think you don't want to be able to do so, because maintaining the R 
sources will get much harder if development of the package management is 
that different under Unix-alikes and Windows. From my point of view the 
aim should be to join, not to diverge here ....

Uwe


BTW: Note that creating packages in such an easy manner does not remind 
people to write their documentation. And if nobody tells me to write 
documentation, my function will be useless (even for myself in a couple 
of weeks). But that's just the pedagogical part. ;-)



> but currently install.packages doesn't know how to build, and for most
> Windows users, a fairly substantial effort is necessary to obtain all
> the tools.
 >
> Duncan Murdoch


[Rd] Re: [R] Creating a minimal package
Uwe Ligges