From Martin Maechler <maechler@stat.math.ethz.ch>  Fri Oct  8 15:00:16 1999
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Fri, 8 Oct 1999 16:00:16 +0200
Subject: [R] ts package on CRAN ?
In-Reply-To: <37FDF1E3.2A9B9C80@bank-banque-canada.ca> (message from Paul
 Gilbert on Fri, 08 Oct 1999 09:30:12 -0400)
References: <Pine.GSO.4.05.9910081003590.10042-100000@auk.stats> <99100812411306.00949@ida> <199910081306.PAA14669@sophie.ethz.ch> <37FDF1E3.2A9B9C80@bank-banque-canada.ca>
Message-ID: <199910081400.QAA14714@sophie.ethz.ch>

>>>>> "PaulG" == Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:
(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!")

-- 
Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[R] ts package on CRAN ?
Martin Maechler