[R] Creating a minimal package (was: where does R search when source()?)

Duncan Murdoch dmurdoch at pair.com
Mon Jul 12 15:24:43 CEST 2004


On Mon, 12 Jul 2004 04:32:55 +0000 (UTC), Gabor Grothendieck
<ggrothendieck at myway.com> wrote :

>Duncan Murdoch <dmurdoch <at> pair.com> writes:
>
>: On Sun, 11 Jul 2004 21:28:44 +0000 (UTC), Gabor Grothendieck
>: <ggrothendieck <at> myway.com> wrote:
>: 
>
>: >1. when I run skeleton.package realize that I must use the arg
>: >   path = "library"
>: >   The example that is shown there appears to omit that.
>: 
>: The default is to put it in the current directory.  The assumption is
>: that you started R where you want to work, or have switched to that
>: directory later.  This is usually true for Unix users, but generally
>: not for Windows users.
>: 
>: I'm not sure what sort of change to make here.  path = "library"
>: (literally) won't usually work, because it won't try to create the
>: directory.  Suggestion?
>
>Perhaps we could use:
>
>   path = .libPaths()[[1]]
>
>as the default value of path in package.skeleton.

I've now fixed the DESCRIPTION file generation so it sets the package
name.

I didn't change the path default, but I changed the example (on
Windows) to set the working directory to the user's home directory,
and added a bit of text explaining what else is necessary to make use
of the new package.

When I test it now, the example produces a package that installs and
runs properly (though you do get warnings in the build because of 
various things that need to be manually edited in the man pages).

These changes are available in r-patched.  I'll do a binary build
today, and they should be downloadable from CRAN tomorrow.

Thanks for your suggestions.

BTW, the new R Newsletter describes a facility for working with
packages; I haven't tried it out yet, but it looks like it would be
useful.

Duncan Murdoch




More information about the R-help mailing list