[Rd] package 'stats' needs import directive for 1.9.0?

Swinton, Jonathan Jonathan.Swinton at astrazeneca.com
Fri Feb 27 15:36:31 MET 2004



> From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
> Subject: Re: [Rd] package 'stats' needs import directive for 1.9.0?
> To: "Heywood, Giles" <Giles.Heywood at CommerzbankIB.com>
> Cc: R-devel at stat.math.ethz.ch
... 
> I suggest you don't try: there are already quite a few 1.9.0-specific 
> versions of packages on CRAN, and 1.8.x will be history in a 
> couple of 
> months.
> 
I'm not sure I understand the advice here. I have also hit the same problem,
and it seems reasonable to me to aspire to maintain a single package which
works on both 1.8.x and 1.9.x. 

> On Thu, 26 Feb 2004, Heywood, Giles wrote:
> 
> > I maintain the Irregular Time Series (its) package on CRAN. 
>  I am currently
> > testing a release.  Under 1.8.1 I am able to define a S4 
> generic 'start' as
> > follows:
> > 
> > if(!isGeneric("start")) {setGeneric("start", useAsDefault=start)}
> 
> Why do you need to do that?  You could just define an S4 
> method which will 
> automatically make a generic if needed.

I think that explicit Genericisation (?) has virtues from the point of view
of code legibility.
...
> 
> > However, the additional directive leads to problems under 
> 1.8.1, as one
> > might expect, since 'stats' does not exist under 1.8.1.  
> How to define my S4
> > generic and make it transparent so that the base function start() is
> > unaffected, in such a way that it will function under 1.8.1 
> and 1.9.0?
> > 
My solution was to only do a require(stats)  if running > 1.9.



More information about the R-devel mailing list