Skip to content

problems with compiling a package

3 messages · R Heberto Ghezzo, Dr, Brian Ripley, Gabor Grothendieck

#
Hello, I am trying to compile packages for R2.0.0 patch in a win XP machine.
Most of the packages compile without problems, with C or FTG or only R.
Now some packeges give the following error which I do not understand how to
correct
...
preparing package xxx for lazy loading
Error in "names <- .default"('*tmp*',value=c("R","Platform","Date",   :
  names attribute[4] must be the same length as the vector [3]
Execution halted
make: *** [lazyload] Error 1
....
Can somebody tell me how I can correct this error?

One other question, this npreparing package for lazy loading does not occur for
all packages, although their DESCRIPTION and folders are similar, When does a
package goes to lazy loading and when it does not?
Thanks
Heberto Ghezzo
McGill U
Montreal - Canada
#
On Tue, 16 Nov 2004 r.ghezzo at staff.mcgill.ca wrote:

            
What exactly is `R2.0.0 patch'?  If you mean 2.0.0 patched, it has a date, 
and the date is crucial.
My guess is that this comes from tools:::.split_description which has

     if(!is.na(Built <- db["Built"])) {
         Built <- as.list(strsplit(Built, "; ")[[1]])
         names(Built) <- c("R", "Platform", "Date", "OStype")
         Built[["R"]] <- package_version(sub("^R ([0-9.]+)", "\\1",
                                             Built[["R"]]))
     } else Built <- NULL

so probably your DESCRIPTION file is faulty.  Did you have a Built: line
in it that you put there yourself?  I can reproduce this by doing so.
If so, `Writing R Extensions' does say

   There should be no @samp{Built} or @samp{Packaged} fields, as these are
   added by the package management tools.

and R CMD check on such package throws an immediate error.
Please do read the NEWS (or ONEWS) file!  It says in the first 20 lines

         Packages are by default installed using lazy loading if they
         have more than 25Kb of R code and did not use a saved image.
#
<r.ghezzo <at> staff.mcgill.ca> writes:
: One other question, this npreparing package for lazy loading does not occur 
for
: all packages, although their DESCRIPTION and folders are similar, When does a
: package goes to lazy loading and when it does not?

You can use 

LazyLoad: no

in the DESCRIPTION file to prevent lazy loading.  
Alternately you can use the --no-lazy switch on 
R CMD install