Skip to content
Prev 2694 / 63424 Next

ts package on CRAN ?

(privately to me,
 I'm cc'ing to R-devel since this should be of a wider interest)

    MM> However, if "tseries" would just contain a
    MM> require(ts)

    PaulG> So this is how this is suppose to be done. I guess I should read
    PaulG> some documentation somewhere. 

help(library)

 (especially the last sections) should give quite a bit of info on this.

    PaulG> Should this be "in line" in the
    PaulG> library file or should it be in the .First.lib file?

There's no such thing as a ".First.lib" file; of course,
you mean the commonly used  zzz.R  file (containing the  .First.lib <- .... )

Answer: Well, it depends.. :
Usually it doesn't matter where the require() is;
Current practice 
 (grep'ing in my directory tree of all the source of all the CRAN packages)
reveals that people have adopted several different ways of doing this.

The zzz.R (which should also contain the .First.lib definition)
is good place to put such a general require().
Recently, we had a case where using
aaa.R (I think, even "Aaa.R") instead was recommended  
{Idea: aaa.R would come at the very beginning of the installed package source}

If only very little functionality of a package depends on another
(non-standard) package, I'd consider to put the  require(..)
only inside the function requiring the package, something like

  if(!require(<pkg>))
   stop("The function `...' can only be used when package <pkg> is available!")
Message-ID: <199910081400.QAA14714@sophie.ethz.ch>
In-Reply-To: <37FDF1E3.2A9B9C80@bank-banque-canada.ca> (message from Paul Gilbert on Fri, 08 Oct 1999 09:30:12 -0400)