From hpages at fhcrc.org  Tue Oct 18 19:05:49 2011
From: hpages at fhcrc.org (=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=)
Date: Tue, 18 Oct 2011 10:05:49 -0700
Subject: [Rd] Creating a package skeleton with no flesh
In-Reply-To: <4E99817C.3060406@gmail.com>
References: <4E98CAFB.6030109@fhcrc.org> <4E99817C.3060406@gmail.com>
Message-ID: <4E9DB1ED.6070704@fhcrc.org>

On 11-10-15 05:50 AM, Duncan Murdoch wrote:
> On 14/10/2011 7:51 PM, Herv? Pag?s wrote:
>> Hi,
>>
>> Wouldn't it be awesome if package.skeleton() could be used to
>> produce, well... a package skeleton? In a fresh R session:
>
> Empty packages are almost identical, differing only in the name entry in
> the DESCRIPTION file.

And also in the name and content of man/mypkg-package.Rd

> So why not do this once manually, and just copy it
> into place the next time you need one? Why do you ask other people to do
> work that is trivial for you to do?

I'm reporting a bug. Bugs that have easy workarounds are still bugs
aren't they? In that particular case, the culprit is this line:

   have <- unlist(lapply(list, exists, envir = environment))

which could be replaced by this one:

   have <- vapply(list, exists, TRUE, envir = environment)

so at least the code doesn't break before the test for "no R objects
specified or available" can be performed. It still doesn't make sense
that package.skeleton() is not supporting that case though...

Thanks,
H.

>
> Duncan Murdoch
>
>> > package.skeleton("mypkg")
>> Error in !have : invalid argument type
>>
>> This (not very informative) error message seems to occur because
>> I'm trying to create a skeleton with no flesh on it:
>>
>> > foo<- function() {}
>> > package.skeleton("mypkg")
>> Creating directories ...
>> Creating DESCRIPTION ...
>> Creating NAMESPACE ...
>> Creating Read-and-delete-me ...
>> Saving functions and data ...
>> Making help files ...
>> Done.
>> Further steps are described in './mypkg/Read-and-delete-me'.
>>
>> A package with nothing defined in it is still a valid package.
>>
>> Thanks,
>> H.
>>
>


-- 
Herv? Pag?s

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



[Rd] Creating a package skeleton with no flesh
=?ISO-8859-1?Q?Herv=E9_Pag=E8s?=