My "g.data" contributed package fails under R-devel. g.data creates minimal packages which consist only of a "DESCRIPTION" file and the "R" and "data" subdirectories, but .find.package() now rejects them because the DESCRIPTION file lacks a "Version" field. I will fix g.data to add a "Version" field. My question is, what else is necessary for a minimal package? "Writing R Extensions" states: "The `Package', `Version', `License', `Description', `Title', `Author', and `Maintainer' fields are mandatory..." So should I really add all these (superfluous) fields, to avoid future rejection? (A comment inside .find.package() refers to tools:::check_package_description, but I could not find such a function. Is there a plan for a universal package validator, and if so, what are its requirements?) Bigger picture, will g.data be rendered obsolete by lazy loading? -- -- David Brahm (brahm@alum.mit.edu)
> My question is, what else is necessary for a minimal package? "Writing R > Extensions" states: > "The `Package', `Version', `License', `Description', `Title', `Author', > and `Maintainer' fields are mandatory..." > So should I really add all these (superfluous) fields, to avoid future > rejection?Mandatory does seem to imply something being mandatory. :)
On Wed, 25 Aug 2004, David Brahm wrote:> My "g.data" contributed package fails under R-devel. g.data creates minimal > packages which consist only of a "DESCRIPTION" file and the "R" and "data" > subdirectories, but .find.package() now rejects them because the DESCRIPTION > file lacks a "Version" field. I will fix g.data to add a "Version" field. > > My question is, what else is necessary for a minimal package? "Writing R > Extensions" states: > "The `Package', `Version', `License', `Description', `Title', `Author', > and `Maintainer' fields are mandatory..." > So should I really add all these (superfluous) fields, to avoid future > rejection?At least Package, Version and Title are not superfluous: they are used by library().> (A comment inside .find.package() refers to tools:::check_package_description, > but I could not find such a function.It is tools:::.check_package_description ^> Is there a plan for a universal package > validator, and if so, what are its requirements?)It's called R CMD check, and also we have long required that packages be INSTALLed. So we require valid metadata in pkg/Meta and a Built: field in the DESCRIPTION, since 2.0.0 will require a package to have been INSTALLed under 2.0.0. (That has implications for the indices too.)> Bigger picture, will g.data be rendered obsolete by lazy loading?Is any one using it? Lazy data loading in a package seems much simpler to me, as did direct use of delay() earlier. -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
I wrote:> My "g.data" contributed package fails under R-devel...because the > DESCRIPTION file [of packages it creates] lacks a "Version" field. > My question is, what else is necessary for a minimal package? > A comment inside .find.package() refers to tools:::check_package_description, > but I could not find such a function.Prof Brian D. Ripley <ripley@stats.ox.ac.uk> responded:> It is tools:::.check_package_description > ^Thank you! I see the typo in the comment (line 690 of library.R) has now been corrected. .check_package_description() and "Writing R Extensions" both clearly and consistently state that `Package', `Version', `License', `Description', `Title', `Author', and `Maintainer' fields are mandatory, so I have added these to the packages (DDP's) that g.data creates. g.data_1.5.tar.gz is now available on CRAN. Maybe someday I'll do a major re-write to use lazy loading, but not today... -- -- David Brahm (brahm@alum.mit.edu)